This worked fine in 5.9.8, but stopped working in 5.9.9. When I roll back to 5.9.8, everything works fine again. Everything else is on their latest version.
To be perfectly clear, this is about ACF’s option page. Normal ACF fields seem to work fine.
ACF option fields do not render in Query Addon 5.9.9
Replies
Responses
-
Member
I assume it might be the sameissue.Bug Report: ACF Site Option dynamic binding crashes Image element block preview in Gutenberg editor
I found an issue with Dynamic Content rendering when using the “ACF Site Option” source in the Image element block.
Environment:
Greenshift / Greenlight Pro
ACF Pro (Options Page)
Field Return Format in ACF: Image ID (integer)
Steps to Reproduce:
Create an ACF Options Page field (e.g. field name:
image-fieldname, return format: ID to Image URL).Add an Image Block in Gutenberg and open Dynamic Content settings.
Select Source: “Site data” -> “ACF Site Option”.
Set Option Name to clean field name:
image-fieldname(without theoptions_prefix, as required by ACFget_field).Set Add Data Format: “ID to Image URL (Full size)”.
Observed Behavior:
In Gutenberg Editor: The block crashes immediately with the error: “This block has encountered an error and cannot be previewed”.
On Frontend: The image renders completely fine.
Additional Testing Notes:
If I change the field name to
options_qr-alfawith “ACF Site Option” or “Site Option”:In Gutenberg Editor: Preview in Gutenberg editor works and displays the image.
On Frontend: Fails to render (no tag generated on frontend because
get_field('options_image-fieldname‘, ‘option’) looks for non-existentoptions_options_image-fieldname). -
Member
I would like to use ACF Site Option – image-fieldname,but it crashes in gutenberg editor.It seems there is an uncaught JS error in the editor’s REST API / preview handler when parsing
ACF Site Optionwith a clean field name and convertingID to Image URL.Could you please check the REST API evaluation logic for
ACF Site Optionin the editor?Thank you!
-
Member
would like to comment this:
this practically worked always. We always have ACF option field and Site option field. Question is why you used Site option to retrieve ACF option?I like greenshift, but sometimes, especially query / dynamic things, are driving me, and I guess other users, little bit confused.
I remember checkbox “This issue is related to Query / Dynamic” that appeared in previous support system after some time of using that service. I think this is the reason.
I used to use Elementor and other tools to build websites, and dynamic things in other tools I tried were Always Intuitive.
With Greenshift these things are many times impossible to guess, I remember many support tickets I wrote to support related to dynamic things where I stuck.
I rememeber I wrote many support tickets about this particular issue with retrieving images from ACF – Options page. I remember it was the last thing I could manage to make it work, after month or even years of trying to make it work. I was avoiding retrieving pictures from ACF – Options page.
I cannot say 100% correct (it was long ago), but I think it is 95%+ chance, that thу answer to this question:
Question is why you used Site option to retrieve ACF option?Is “Because Greenshift support told me to do so” after countless attempts to figure it out myself.
Dont get me wrong, I like greenshift and willing to keep using it.
The functionality part is great, but invest some time into Interface and interaction with user. Mosaic or even Elementor is a good example of interacting with user.
-
Member
I have already done a full PHP debug step-by-step using a custom shortcode (
get_field('image-fieldname', 'option')) directly on the page to verify what ACF returns.What ACF actually returns:
It returns a strict integer ID:
int(47041).Usingwp_get_attachment_image_url(47041, 'full')andwp_get_attachment_image(47041, 'full')successfully outputs both the valid image URL and the full<img>HTML tag on the frontend. So ACF return format, database integrity, and media attachments are 100% correct.The Current Conflict:
When using
Site Optionwithoptions_image-fieldname:In Gutenberg: The editor preview works fine.
On Frontend: Fails completely (no
<img>tag) due to the new 5.9.9+ security restriction onwp_optionskeys (unless manually whitelisted via thegreenshift_dynamic_allowed_optionsfilter).When using
ACF Site Optionwith clean field nameimage-fieldname:On Frontend: Works as expected. The image renders correctly.
In Gutenberg: The block crashes in the editor with the error: “This block has encountered an error and cannot be previewed”.
Steps to Reproduce the Gutenberg Editor Crash:
Create an ACF Options Page field set to Return Format = Image ID (e.g. field name:
image-fieldname).Add a Greenshift Image block on a page in Gutenberg.
Open Dynamic Content settings: Select Site data -> ACF Site Option.
Set Option Name =
image-fieldname(clean ACF field name, without theoptions_prefix).Set Add Data Format = ID to Image URL (Full size).
Observe: The block crashes in the Gutenberg UI with “This block has encountered an error”, even though saving the page and viewing it on the frontend works perfectly.
Conclusion:
ACF is working properly and the frontend logic for
ACF Site Optionis correct. The issue is strictly a JS/React exception handling error in the Gutenberg editor when evaluatingACF Site OptionwithID to Image URLformatting in the backend preview.Could you please fix this JS evaluation crash for
ACF Site Optionin the next plugin update?P.S. On a side note, I want to mark the Greenlight block settings right sidebar UI. It is really good designed, fast and very convenient for use.
-
Member
Image element crashes when Dynamic Link – Site data – ACF Site Options – field is chosen.Any updates on this issue?
Post a Reply
You must be logged in to post a comment.