Accueil › Toolset Professional Support › [Résolu] PHP notice occurring in AJAX response when view is filtered
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 |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
Marqué : Types plugin, Views, Views plugin
Ce sujet contient 6 réponses, a 2 voix.
Dernière mise à jour par Beda Il y a 6 années et 3 mois.
Assisté par: Beda.
Hi there,
On lien caché we have a toolset view that updates via ajax when the filter values change.
With chrome's network inspector open, choose a year or destination in the search form
it fires off an ajax request
and the ajax request's response has PHP notices printed in the response.
The notices are:
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>139</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/nas/content/live/gewireframe/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php</b> on line <b>148</b><br />
Our view uses a content template for each row, and the content template is built using beaver builder.
There appears to be a bug in Views during the AJAX request, which causes the AJAX response to fail.
Attached is a screenshot of the AJAX response, as well as a screenshot of the the view's configuration.
To work around the problem on the public cruises page (lien caché) we've changed the other view to submit via full page reload.
Could you please investigate and resolve the bug with the AJAX functionality when using a view with content template and beaver builder?
Thank you!
Right, I can see the issue on your site.
I can however not yet replicate this locally.
Would you mind sending me a copy of that site so I can have a look?
It may be that you use custom code or other plugins or themes, can you please as well make sure the issue is not happening when you use just Toolset and Theme Twenty Seventeen?
If the issue persist, please send me the duplicate if possible.
https://toolset.com/faq/provide-supporters-copy-site/
OK; I finally managed to download and recreate this site.
I see more errors.
( ! ) Warning: Parameter 2 to WPE\Site_Preview::the_posts() expected to be a reference, value given in .../wp-includes/class-wp-hook.php on line 286
That is not solved if the builder is disabled on the page.
It's only solved once the BB Builder is deactivated completely.
If you activate it, this happens as well:
( ! ) Deprecated: Function create_function() is deprecated in .../mu-plugins/wpengine-common/plugin.php on line 443
So you use MU plugins (must use) on top of the given ones that seems to conflict.
Note that the error mentioned above isn't gone if I disable Toolset completely:
( ! ) Warning: Parameter 2 to WPE\Site_Preview::the_posts() expected to be a reference, value given in .../wp-includes/class-wp-hook.php on line 286
I doubt the underlying reasons for this issue are in Toolset, it seems the reason is in the BB plugin, but I need to investigate that carefully first.
I will need some more time for this, it includes a lot of testing and making sure no other stuff interferes.
I will feedback ASAP and keep an eye open for similar issues (until now none AFAIK) so I do not mistakenly oversee a bug
It seems this is something due to the builder that exceptionally acts up now.
I'll find what it is and update you here.
BTW there are I see now more errors:
( ! ) Parse error: syntax error, unexpected 'elseif' (T_ELSEIF) in .../mu-plugins/wpengine-common/admin-ui.php on line 480
This, as well without Toolset, in wp-admin/admin.php?page=wpengine-common of the install.
Back to this, I removed all must use plugins, cache plugins and codes, updated the page builder, activated Toolset and the Builder, as well as the BB Theme and the Themer.
Since WordPress had a maintenance release, I updated that as well.
The wp-config.php was heavily customized.
I can still see the issue when I use the AJAX View search:
PHP Notice: Trying to get property 'ID' of non-object in .../types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php on line 139 (and 148)
I saw in the code, that global $wp_the_query; here is giving an empty value for $wp_the_query->post, but [in_the_loop] => 1.
The exact purpose if the code that throws the error, is to fake a post, for this reason:
In Beaver Builder 2.0, when the FLBuilder::render_content method is used, Beaver Builder is getting the post ID by forcing globals, which means that they force the use of WP globals instead of checking their internal post ID.
The WP globals contains the post currently rendered and not the Content Template, so we need to temporarily set the Content Template in the $wp_the_query (which they use) and then put the old post in its place after the content is rendered.
So since there is no post, later if ( (int) $template_selected !== $wp_the_query_post->ID ) { will fail as there is no id either of that non-object.
I was able to replicate this BUG, and have reported it.
For now, solutions should be:
- Not using a Content Template (not the best idea)
- Not using AJAX (for now probably the proper solution - this should work)
I'll be back here once it's solved.
BTW; do you recall when this started to happen?
Hi Beda,
This is a brand new website that we've built in the last few weeks only. I don't think it has ever worked since we set it up.
It's the first project that we've used beaver builder inside of a toolset view.
I appreciate you looking into this, I look forward to hearing back from you once the underlying bug/issue has been solved.
In the short term we are using a non AJAX view as a workaround.
James
OK great.
The issue is now escalated and the developers will work on this to be fixed.
I'll notify you here once it is.
This is solved:
https://toolset.com/errata/fix-a-php-warning-happening-for-content-templates-built-with-beaver-builder-used-inside-views-with-ajax-search/
Thanks for the heads up and patience!