Skip Navigation

[Closed] Php Notice

This support ticket is created 2 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 16 replies, has 3 voices.

Last updated by Waqar 2 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2405979

Hi,

What does the error debug.log file mean. Website is running on PHP 7.4.3. What should I do?

[27-Jun-2022 00:47:50 UTC] PHP Notice: Trying to get property 'ID' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-theme-settings/compatibility-loader/toolset-theme-integration-settings-helper.php on line 426

Thanks, Jelle

#2406079

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

We don't have any existing reports about the same notice.

Do you know if there was any particular action taken at the time the notice was generated, so that we might try and replicate it?

Is this a one-off message in your logs, or a recurring message (how often is it appearing)?

#2406389

Hi Nigel,

I'm not sure, but the message seems to return on a regular basis.

Br, Jelle

#2406725

Hi Jelle,

Thanks for writing back.

Looking into the code mentioned in the PHP notice, it would only be produced if, for some reason, the current post's scope is not available. It is very strange because the code itself is set to only run on the single post pages, where the current post's scope should be available at all times.

I suspect that some third-party plugin or theme is interfering with that current post's scope in some very specific situation, but, during some tests on my website, I couldn't reproduce this.

By nature, the PHP notice itself is safe to ignore. For further investigation, I'll recommend noting down when a new instance of this notice is generated in the error log and determining exactly which section of the website was being edited at that time.

This will help in narrowing it down and we might also have to request the website's clone, for that troubleshooting.

I'll keep this ticket open for now.

regards,
Waqar

#2406737

Hi Waqar,

Thank you. That's good to know. I have a copy running for translation purposes on a different domain. This website isn't showing these errors. So I guess there is something wrong with this specific configuration. I changed some settings, now see how it goes. If necessary, I'll get back to you.

Br, Jelle

#2406767

Sounds good and I'll wait to hear back from you.

#2408427

Hi Waqar,

I got rid of some the notifications/errors. Below the most recent one's. The one from Toolset is still there. Not sure what to do?

[30-Jun-2022 01:08:37 UTC] PHP Notice: Undefined index: stock_status in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/wpai-woocommerce-add-on/libraries/XmlImportWooCommerceService.php on line 361
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'ID' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-theme-settings/compatibility-loader/toolset-theme-integration-settings-helper.php on line 426
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'ID' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/google-analytics-premium/pro/includes/frontend/class-frontend.php on line 336
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:45 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'ID' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-theme-settings/compatibility-loader/toolset-theme-integration-settings-helper.php on line 426
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'ID' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-content/plugins/google-analytics-premium/pro/includes/frontend/class-frontend.php on line 336
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338
[30-Jun-2022 07:11:56 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/www/vhosts/light4u.io/httpdocs/wp-includes/class-wp-query.php on line 4338

Br, Jelle

#2408447

Thanks for writing back.

Can you please share the temporary admin login details of the website where this error is being generated? I'll also need your permission to download a clone/snapshot of the website, in case it needs to be investigated on a different server.

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

#2409077

Thank you for sharing the admin access.

I couldn't find anything obvious from the admin area, so I downloaded a website's duplicator package.

I'll be performing some tests on this clone and will share the findings, as soon as this testing completes.

Thank you for your patience.

#2409107

Hi Waqar,

Thanks for letting me know. Oke, looking forward to your findings.

Br, Jelle

#2410823

Just wanted to update you that I'm still working on this and will be able to share my findings, today.

#2410903

Hi Waqar,

Great, thanks for letting me know!

Br, Jelle

#2411329

Thank you for waiting.

I've been randomly visiting different front-end and admin area sections on your website's clone, but so far haven't seen the same notice about the missing post object/ID.
(I have the same PHP 7.4.30 version on this test server, as your website)

I suspect this is related to the cache, optimization, and CDN plugin enabled on your website, as these are the only plugins that are disabled on the clone that I have.

It seems, that one of those plugins is calling WordPress' "is_singular" function, earlier than the post object has been set or for a post/revision, that no longer exists. And as a result, the notices are recorded. And those notices are not just coming from Toolset. You'll see similar notices getting generated by the code from plugins like 'google-analytics-premium', 'wpai-woocommerce-add-on', and even WordPress file 'class-wp-query.php'.

I'm afraid, it won't be possible for us to investigate deeper into a notice that is not limited to Toolset, but, the good news is that I don't expect this notice to cause any functional issue on your website.

#2411513

Hi Waqar,

Great, thanks a lot for your efforts and investigation! Good to know that it won't cause any functional errors. I will contact Litespeed and/or EWWW to investigate the issue and will share your findings with them to check.

Thanks again!

Br, Jelle

#2411545

You're very welcome and let us know in case you need any assistance from the Toolset side.

The topic ‘[Closed] Php Notice’ is closed to new replies.