Hello,
We have a multi site that is using WPML (the lastest version), with DE as primary language and FR as secondary
We are having 2 issues.
1. On the main site we are getting all the posts from subsites using WP_Query. It's working fine on the main language but on FR we are getting this critical error (Attempt to assign property "object_id" on bool), check screenshot attached. Most of the subsites are displayed but some are throwing this error.
2. For some posts from the subsites on the on the main language DE wp_get_post_terms is not returning "category" but "translation_priority" as terms, check screenshot attached.
We added the supress_filters parameter to the WP_Query arguments but it didn't fixing anything.
In the code that I have attached above we are just looping all the sites and running a WP_Query to get the posts from each one of those sites to the main site.
The issue is that WP_Query or get_posts are throwing this error, Critical error (Attempt to assign property "object_id" on bool).
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
ok, then tell me something else. this code, is added to a plugin, an integration with something, to the functions.php or something else?
Would it be possible to have, say a clean staging site with this code added? with nothing else but the code and without plugins or just wih the ones needed to run the code?
I can't debug the code for you but if i have a site on a minimal or clean installation (with just the minimal set of variables needed to recreate the problem without interference by plugins, themes or other custom code) then i can try to take a look and see if i can find any clue about what's going on.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
Hello!
I checked the code and while it's way outsidethe scope of our support i saw that it was indeed working ok, and you can see that too when most of the posts retrieved are ok.
the wrong language issue was likely because of the suppress_filters. that arg was removed when i checked it and i couldn't see that problem, however the fact that the problem only happens in some very specific posts is a clue. maybe those posts do not have a translation? maybe they do not have a category selected?
Frankly i'm a bit confused about the code since you mentioned it's pulling content from other subsites, however, at least for the content that is failing, they exist in the vif subdomain, they have the same categories same slugs and everything so let's do the following:
- let's pick a reference post: hidden link (in all its languages)
- Check how it differs from other posts that ARE showing the correct category
- Maybe rename the categories and slugs to something that won't create too much problem on the view (add a character or remove one) and make every language different for those categories so we can understand where is the site pulling them from on other posts that are working correctly.
Then check again to see if you get other clues about them and let me know.
Setting 'supress_filters' => true, doesn't fix the issue. Still the wrong category term label is rendered on the page (each one of those posts has a category term assigned)
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
I know it doesn't and that's not what i asked, in fact i believe that's why you say german posts in the other language.
I asked you something else, so please re-read my last message and let me know how it goes.
I really want to help you but you're working with custom code on a multisite with different sites that all have the same categories, same slugs in different subsites so it's very difficult for me to even check it out without the info that i requested.
Regards.
The topic ‘[Closed] Critical error (Attempt to assign property "object_id" on bool)’ is closed to new replies.