-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✅ 🐞 🧩 Fatal error with Dynamic tags and ACF causes editor to stop loading in some edge cases #29160
Comments
Hey @hogash! How's it going? Thank you for submitting this issue! 🙏 I'm going to have to investigate it further. Can you please share the field type used, and its configurations so we can reproduce it on our side? Kind regards |
Hey Nick, hope you're doing well too! :) I just used a color picker field but I don't think that was too relevant. I managed to partially replicate the error on a clean site ( Elementor + Pro + Hello + ACF + Woo ) but not the error that's blocking the editor, instead it blocks the preview. I recorded a video here of what I did https://d.pr/v/PbZ2M7 . Basically embedded a template inside the header, in which I've added a widget that lists some terms ACF fields data ( the widget is custom, just to use And here's the entire website exported with All in one Migration https://d.pr/f/0p0TCb ( login: admin / 123456 ) . Please let me know if that's ok or you need any extra info. Thanks!! 🙏 |
hello, I was having the same problem and I managed to solve it using the wordpress medatada query. It even took down my whole website. The easiest solution was to change the ACF query $item = get_post_meta(get_the_ID(), 'Your_Term', true); And this way the error was mitigated. I hope to help you |
I have also encountered a similar issue: |
I've also run into this issue. As @hogash has correctly identified, it's because @nicholaszein Please see my support case #TS2R8AQR2KK7 where I too have shared videos demonstrating the cause of this issue. Thanks |
Not sure if this is related, but also noticed that any ACF Option Fields return NULL when previewing a Draft (Post, Page). This is only an issue with Elementor Pro 3.25 and above. Disabled Elementor Pro and everything works. Ended up reverting to 3.24. to resolved. |
I want to share my story and experience related to this issue in Elementor Pro. Perhaps my experience will be useful for other users and developers. Problem DescriptionAfter updating WordPress to version 6.7.1 and several plugins, including Elementor and Elementor Pro, I encountered two main problems:
Error LogsWhen attempting to preview the standard WordPress editor, the following error appears in the debug log:
Analysis and Debugging
SolutionI commented out the addition of the filter in the Elementor Pro file: // /wp-content/plugins/elementor-pro/modules/dynamic-tags/acf/module.php on line 27
// add_filter( 'acf/pre_load_post_id', [ $this, 'filter_post_in_preview' ], 10, 2 ); After this, the site began to work correctly, and the preview mode functioned as expected. Site StructureI use a custom post type. For it, a separate file ConclusionThe issue arose because Elementor Pro adds the I hope my experience helps in resolving this issue in future updates. P.S.S. I apologize for such a long comment. This is my first comment :) |
You are right, when I publish template (via Wordpress edit) I can edit it with Elementor and there is no error. Creating new one is impossible without seeing error, but it is creating drafts. |
Hello, Good day. May I ask if this issue has been resolved on the recent patches? I am getting this error today too. I had to change my PHP version to 7.4 and change the Elementor version to 3.24.4 to fix the preview issue. However, it doesn't display the dynamic values of the templates.
Thank you, |
It is not solved yet, We have the same problem with Elementor PRO version 3.26.3. Just updated yesterday (22025 jan 12th). |
Same issue here. Thanks @rekki13 for the quick fix. |
Same issue here as well, When upgrading to Elementor Pro 3.25 and above, I receive Fatal Errors resulting in a broken page/layout when viewing preview mode as others have experienced.
I rolled back to Elementor Pro 3.24 which fixes the issue, however deferring any upgrades long term isn't ideal. I went ahead & applied @rekki13 solution, the fix works with Elementor Pro 3.25 and above. I hope the awesome folks at Elementor can come up with a stable solution for this bug to eliminate having to defer version upgrades for Elementor Pro. |
Hi everyone! It's been a while... Apologies for the delay. Thank you @hogash, @edwardkay, @blockmonkey, and @rekki13! Your feedback helped us identify and safely reproduce this issue! 🙏 We are working on a solution for this issue, and I will update you as soon as I have more information. Meanwhile, a workaround for this issue is to Publish your documents before trying to edit with Elementor. We understand this may not be the desired solution in some cases, but it helps prevent this issue from happening. Until next time! Nick |
Hey everyone! We have great news! 🙌 📢 We're happy to announce that the issue you raised was resolved in Elementor v3.28.0! 🥳✅ Feel free to check it out and update your plugin to the new version!
Note If you still think this is a bug, please follow the guidelines for opening a new 🐞 Bug Report, so we can help you better. Cheers 🥂 |
Prerequisites
Description
The error is
PHP Fatal error: Uncaught Error: Object of class WP_Term could not be converted to string in /advanced-custom-fields-pro/includes/acf-value-functions.php:96
causing the editor to stop loading with the error https://d.pr/i/pkuhA0 .The problem seems to be coming from
ElementorPro\Modules\DynamicTags\ACF\Module->filter_post_in_preview
which returns$post_id
instead of$null
. I actually believe it's just an unintentional bug, rather than specifically set to return$post_id
.The method is hooked into ACF's
acf/pre_load_post_id
filter which short-circuits load_value logic. This causes problems with ACF and WP_Term when used asget_field('some_field', $the_term_object)
.So because
acf/pre_load_post_id
is a short-circuit filter it should only handle a specific case, not all cases and it must return$null
(the original filtered data).Steps to reproduce
It's a bit complicated to replicate because it happens with my commercial theme (Rey), when there's a mega menu with WooCommerce attributes inside ex: https://d.pr/i/f9zKoG .
I'm not sure if it happens with other plugins/themes but judging by the code I recommended above I believe it will probably start happening in other scenarios too.
Expected behavior
Isolating the problem
Elementor System Info
Click to reveal
Agreement
The text was updated successfully, but these errors were encountered: