Hi Support
We got our custom codes editable again 😅, but now we are seeing an error message when we view the page hidden link:
Notice: Trying to get property 'source_language_code' of non-object in .../toolset-customizations/func-check-if-post-is-wpml-original.php on line 14
I don't believe the code changed so wondering what the error is.
I will need to provided you with a login, so please convert this to a ticket and open a private reply?
Thanks and regards
Simon
Hello Simon,
I tried to check this issue, but I do not see any errors with both, nanny's and family's account. I am getting a 404 error for both accounts.
Can you tell me how to reproduce this issue? And I'll try with a copy that I have taken today for the previous ticket.
I might also need FTP access to check the debug.log file. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Hi Jamal
Quick update - I also spotted that the "old" function ts_is_post_wpml_original was still registered under Toolset > Settings > Front-end Content > Functions inside conditional evaluations. I registered the following two "new" functions there too, but still getting the error messages.
- func_is_job_ad_wpml_original
- func_is_nanny_ad_wpml_original
Do we still need to register those there if we use the shortcode for the conditional expression instead of the function version where we pass in the wpv_post_id as per your suggestion in an older ticket? (https://toolset.com/forums/topic/ajax-not-working-correctly-with-wpml/page/2/#post-1722943)
Thanks and regards
Simon
Hello Simon,
In order to use a function or a shortcode inside conditionals, it needs to be registered.
I took a new Duplicator copy of your website and worked on it locally. It turns out that for some reason the shortcode needs to get the post ID. Replace:
[is_nanny_ad_wpml_original]
To:
[is_nanny_ad_wpml_original post='[wpv-post-id]']
I have also introduced a new check on the snippet "func-is-nanny-ad-wpml-original" line 14. Change:
if ( $info->source_language_code !== null) {
To:
if ( isset($info->source_language_code) && $info->source_language_code !== null) {
You will need to do the same for the Job Ads too.
I hope this helps. I'll remain at your disposal.
HI Jamal
That's working now as far as I can see! Thanks for the code adjustment!
My issue is resolved now. Thank you!