soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
315 stars 31 forks source link

Oxygen breaks Blocks 💨💔🧱 #3525

Closed perrelet closed 1 month ago

perrelet commented 2 months ago

Steps to Reproduce

Note: This bug is not directly reproducible in the sandbox environment. Unfortunately the wp-includes directory and it's contents are locked in the sandbox, so we were unable to test why this is the case. as qsandbox.org uses Wordpress version: 6.4.2, the bug only happens in WP 6.5.2

  1. Blank install + oxygen.
  2. Install a plugin that registers a block that enqueues some script / style via editorScript, script, editorStyle or style. (e.g buddypress)
  3. Load the Gutenberg editor.
  4. Note the 404 in console:
Failed to load resource: the server responded with a status of 404 ()

https://website.com/wp-content/themes/oxygen-is-not-a-theme/var/www/website.com/wp-content/plugins/safe-svg/dist/safe-svg-block-frontend.css?ver=6.5

The error was reproducible on two separate blank installs on two totally different hosting configurations.

The Problem

Oxygen breaks get_block_asset_url with the following overrides:

function ct_oxygen_template_name($template) {
    return "oxygen-is-not-a-theme";
}
add_filter("template", "ct_oxygen_template_name");
function ct_disable_theme_load( $stylesheet_dir ) {
    return "fake";
}
add_filter("template_directory", "ct_disable_theme_load", 1, 1);
add_filter("stylesheet_directory", "ct_disable_theme_load", 1, 1);

Details

  1. During block initialization, register_block_style_handle calls get_block_asset_url with the path of each of the blocks dependencies.
  2. Because get_template_directory is forced with a value of "fake", wp_normalize_path( realpath( get_template_directory() ) ) is always empty - because the path doesn't exist.
  3. Thereby, trailingslashit( $template_paths_norm[ $stylesheet ] ) always equals "/"
  4. Thus, when WordPress's check to see if the dependency path string starts with the template path string, the result is always true. (All paths start with a /)
  5. As a result, WordPress erroneously calls get_theme_file_uri with the path (despite it actually being a plugin path), producing a garbled url like:

https://website.com/wp-content/themes/oxygen-is-not-a-theme/var/www/website.com/wp-content/plugins/safe-svg/dist/safe-svg-block-frontend.css?ver=6.5

Kpudlo commented 2 months ago

Confirmed and reported internally via https://github.com/soflyy/oxygen/issues/5359

Kpudlo commented 2 months ago

Hi @perrelet,

Have you encountered this error with any plugins other than BuddyPress?

perrelet commented 2 months ago

Yes https://en-ca.wordpress.org/plugins/safe-svg/ is another example 👍

Kpudlo commented 2 months ago

Awesome, thank you!

javierruizjimenez commented 2 months ago

It breaks Rank Math SEO (1.0.216) as well, could be the same issus as #3527

perrelet commented 2 months ago

@javierruizjimenez Thanks for the insight in #3527

Looking at this further https://github.com/WordPress/WordPress/commit/46e8b6fc711036f77027a14a4e6463dd2765977e appears to have caused the bug with the introduction of realpath to get_block_asset_url.

@Kpudlo What are your thoughts on a fix?

Kpudlo commented 2 months ago

Thank you for the additional information, we've added this information to our internal ticket for this issue. Our development team is reviewing the problem.

shoelaced commented 2 months ago

@Kpudlo Do you know any workaround for this, or if there's movement on a solution? I've started getting angry clients writing in to ask why random blocks are broken.

Spellhammer commented 2 months ago

@shoelaced We're working on a fix, but no current workaround. I would recommend not using WP 6.5 until this is resolved if it's impacting your sites.

javierruizjimenez commented 2 months ago

@Kpudlo Do you know any workaround for this, or if there's movement on a solution? I've started getting angry clients writing in to ask why random blocks are broken.

Use Rank Math URL redirections to do a 302 (temporary redirection), here how to do it for Rank Math TOC. Other blocks could do the same until it is fixed:

MichaelSwanUK commented 2 months ago

@shoelaced We're working on a fix, but no current workaround. I would recommend not using WP 6.5 until this is resolved if it's impacting your sites.

I am waiting for the fix, so will not do a Workaround. My issue relates to the Rank Math Table of Contents Block.

Is there an approximate timeframe for a fix and update release?

Thanks!

perrelet commented 2 months ago

@soflyy @Spellhammer @Kpudlo

Given the severity of the issue, it really does feel like this one warrants a little more transparency and communication.

Thanks in advance for keeping everyone here updated and informed.

Spellhammer commented 2 months ago

@perrelet https://github.com/soflyy/oxygen-bugs-and-features/issues/3525#issuecomment-2054169552

Spellhammer commented 2 months ago

Oxygen 4.8.3 RC 1 is now available in the customer portal and addresses this issue. Please test and let us know if you continue to experience any issues with blocks in WP 6.5+.

perrelet commented 2 months ago

@Spellhammer Awesome, would you mind sharing what the chosen fix is or would you prefer us to diff this for ourselves?

perrelet commented 2 months ago

For those also wondering:

 function ct_disable_theme_load( $stylesheet_dir ) {
        // disable theme entirely for now
-       return "fake";
+       return (dirname(__FILE__));
 }
add_filter("template_directory", "ct_disable_theme_load", 1, 1);
add_filter("stylesheet_directory", "ct_disable_theme_load", 1, 1);
kaibrockelt commented 2 months ago

Hi! I'm also affected. Quick question: when I install the RC, which is not supported according to the text here (https://oxygenbuilder.com/beta-access/) , will it return to the stable path with the next upgrade? Or will I need to install it manually?

Spellhammer commented 2 months ago

@kaibrockelt Release candidates are eligible for official support and will be able to update to the next stable release when it's available.

AlkoKod commented 2 months ago

For those who need workaround, create blank theme and use this in mu-plugin/code snippet:

`// Reverse empty stylesheet URL being returned by Oxygen. remove_filter( 'template_directory', 'ct_disable_theme_load', 1, 1 ); remove_filter( 'stylesheet_directory', 'ct_disable_theme_load', 1, 1 );

// Override the theme name change from "oxygen-is-not-a-theme" by Oxygen. remove_filter( 'template', 'ct_oxygen_template_name' ); ` Here is the source: https://www.great-tit.com/enable-wordpress-theme-when-using-oxygen-builder/

Spellhammer commented 2 months ago

@perrelet @AlkoKod @kaibrockelt @MichaelSwanUK @javierruizjimenez @shoelaced

Did 4.8.3 RC 1 fix this for all of you?

shoelaced commented 2 months ago

@Spellhammer Yes it seems to have fixed it for me.

danner26 commented 1 month ago

Any ETA on this becoming a prod build?

MichaelSwanUK commented 1 month ago

I second this. Sent from my iPhoneOn 5 May 2024, at 19:59, Daniel W. Anner @.***> wrote: Any ETA on this becoming a prod build?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Spellhammer commented 1 month ago

@danner26 @MichaelSwanUK Did the RC fix the issue for you? The quicker people let us know that it worked across their various environments/scenarios, the quicker we can release it as a final. There's no reason not to use the RC in production if you've tested on staging and there are no issues.

MichaelSwanUK commented 1 month ago

Yes, the RC worked with my site also. Sent from my iPhoneOn 6 May 2024, at 15:09, Elijah Mills @.***> wrote: @danner26 @MichaelSwanUK Did the RC fix the issue for you? The quicker people let us know that it worked across their various environments/scenarios, the quicker we can release it as a final. There's no reason not to use the RC in production if you've tested on staging and there are no issues.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

javierruizjimenez commented 1 month ago

@Spellhammer I have installed 4.8.3 RC 1 and it fixes the issue.

danner26 commented 1 month ago

It does not look like 4.8.3 RC 1 fixes the issue on our end image

If you want the stack output in full I can create a ticket or you can email me. There is a LOT. Here is a sample of it:

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 19

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenGutenbergPluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/admin/includes/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 19

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenWooCommercePluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-woocommerce/admin/includes/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 20

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 21

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 22

Deprecated: Creation of dynamic property OxygenMainPluginUpdater::$license_text is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater.php on line 23

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$prefix is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 19

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$plugin_name is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 20

Deprecated: Creation of dynamic property OxygenCompositeElementsPluginUpdater::$priority is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/admin/updater/edd-updater-composite-elements.php on line 21
Spellhammer commented 1 month ago

@danner26

This issue is about Gutenberg/Block Editor blocks breaking.

Deprecation notices have nothing to do with this issue.

If there are blocks breaking on your site after upgrading to 4.8.3 RC 1, please email support@oxygenbuilder.com with temporary login credentials and we'll investigate.

danner26 commented 1 month ago

Sorry, here is some more relevant output. I believe these are blocks erroring. Let me know if this relates or not:

Deprecated: Creation of dynamic property Oxygen_Gutenberg::$blocks is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen-gutenberg/oxygen-gutenberg.php on line 74

Deprecated: Creation of dynamic property Oxygen_VSB_Dynamic_Shortcodes::$custom_dynamic_datas is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/includes/oxygen-dynamic-shortcodes.php on line 18

Deprecated: Creation of dynamic property Google\Site_Kit\Modules\Ads\Web_Tag::$home_domain is deprecated in /bitnami/wordpress/wp-content/plugins/google-site-kit/includes/Modules/Ads/Web_Tag.php on line 37

Deprecated: Creation of dynamic property Oxy_Header_Builder::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Header_Builder::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property CT_Inner_Content::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property CT_Inner_Content::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property Oxy_Google_Maps::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Google_Maps::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property Oxy_Header_Builder_Row::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property Oxy_Header_Builder_Row::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Left::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Left::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Center::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Center::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Right::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxy_Header_Builder_Row_Right::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_DIV_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_DIV_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_DIV_Block::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

Deprecated
: Creation of dynamic property CT_Link_Button::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Link_Button::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Link_Button::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

Deprecated
: Creation of dynamic property CT_Fancy_Icon::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Fancy_Icon::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Text_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Text_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Text_Block::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

<REDACTED>

Deprecated
: Creation of dynamic property Oxy_Social_Icons::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxy_Social_Icons::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Link_Wrapper::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Link_Wrapper::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Link_Wrapper::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

Deprecated
: Creation of dynamic property CT_Image::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Image::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Headline::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Headline::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

<REDACTED>

Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property Oxy_Nav_Menu::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

HOME
OUR SERVICES
CONTACT US
BLOG
SUPPORT TICKETS

Deprecated
: Creation of dynamic property CT_Code_Block::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property CT_Code_Block::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated
: Creation of dynamic property CT_Fancy_Icon::$media_queries is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2440

Deprecated
: Creation of dynamic property Oxygen_VSB_Search_Form::$css_states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2420

Deprecated
: Creation of dynamic property Oxygen_VSB_Search_Form::$states is deprecated in
/bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php
on line
2421

Deprecated: Creation of dynamic property CT_Section::$css_states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2420

Deprecated: Creation of dynamic property CT_Section::$states is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2421

Deprecated: Creation of dynamic property CT_Section::$media_queries is deprecated in /bitnami/wordpress/wp-content/plugins/oxygen/component-framework/components/component.class.php on line 2440
Spellhammer commented 1 month ago

@danner26 Anything that says "Deprecated: Creation of dynamic property..." is a different issue and unrelated to this one.

If you still have broken Gutenberg blocks while using 4.8.3 RC, please email support@oxygenbuilder.com so we can investigate.

Spellhammer commented 1 month ago

Fixed in Oxygen 4.8.3.