Open andreslotta opened 2 years ago
Having same issue
There's something else at play here. I'm unable to reproduce on a Sandbox or on a local environment.
Do you have any other details you can provide? Can you provide us with a backup of the site where the problem is occurring?
With @andreslotta 's help, narrowed this down to occurring only on pages set as the static home page. Reproduced and reported internally.
The same issue, happening across all pages.
I was able to easily reproduce this in the Oxygen sandbox.
The gear will spin forever and you'll see a "error ocurred while loading attachment sizes" notice in the background.
I was able to easily reproduce this in the Oxygen sandbox.
1. Create new sandbox install on the Oxygen site 2. Choose the default installation 3. Go to the About Me page (any page will cause the error) 4. Click on the hero placeholder image, set to Media Library > Data, choose Post Featured Image
The gear will spin forever and you'll see a "error ocurred while loading attachment sizes" notice in the background.
Thit the same. Same Problom. Also by a test site of my self. Normal images wil load if you browse. If you use Data you got a error.
Hey guys,
I was really happy reading the following line in the Beta 2 changelog: Tweak: Added dynamic data button to image ID field for Images using Media Library - (#4250)
Unfortunately this does not (yet) work as expected. See details below.
Describe the bug Trying to insert an image dynamically with the new "Media Library > data" option does not work and results in an error which makes the builder unusable. I tried it with a page's featured image as well as a custom image field (ACF) added to the page – same error for both variants.
Steps required to reproduce the bug
Expected behaviour The image gets inserted dynamically.
Actual behaviour There is an error ("Error occured while loading attachment sizes"), the builder is grayed out and the loading gear spins indefinitely.
I attached a screenshot showing the issue. You can also see an error in the console. Hope this helps identifying the issue.
Possible cause Since I am always interested in how things work behind the scenes I tried to find out what the problem could be. And I think I found the cause. So hopefully this information helps you to fix this bug more quickly:
In the file image.class.php – line 129 as of Beta 2 – you are doing a shortcode ([oxygen data='featured_image_id']) to dynamically get the image ID. In this shortcode's function (file oxygen-dynamic-shortcodes.php – line 278 as of Beta 2) you call the WordPress function get_post_thumbnail_id(). Without an argument this function relies on the global $post object. And here is the problem: There is no global $post object at the time of calling this function.