Support » Plugin: GDPR Cookie Compliance (CCPA, DSGVO, Cookie Consent) » [bug] Cookie modal in Gutenberg with Oxygen Builder

  • Resolved byraetsydvest

    (@byraetsydvest)


    Hi,

    When using your GDPR Cookie Compliance plugin with the Oxygen Builder, the cookie modal is displayed within the Gutenberg editor in the admin panel, but without any css added to it.

    This, amongst other things, makes a logo uploaded as an SVG fill the entire background of the edit area – making it more difficult to edit posts and pages.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @byraetsydvest,

    Thanks for using our plugins.

    You can add the following code snippet to yout functions.php to prevent loading the GDPR content when editing posts with Oxygen Builder:

    add_action( 'gdpr_modal_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 ); 
    add_action( 'gdpr_infobar_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_branding_styles_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_floating_button_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    
    function gdpr_cc_remove_hidden_elements( $html_content ) {
      if ( isset( $_GET['ct_builder'] ) ) :
    		// This means the user saved the preferences and you don't need to show the modal
      	$html_content = '';
      endif;
    	return $html_content;
    };

    Hope this helps.

    Thread Starter byraetsydvest

    (@byraetsydvest)

    Hi,

    Thank you, that almost helps 🙂

    The problem is not that it loads within the Oxygen Builder itself, but within the Gutenberg builder.

    You can see a screenshot here: https://imgur.com/a/VN76Bo3

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @byraetsydvest,

    It seems the Oxygen Builder uses some custom hooks, and by this, the modules are still loaded in your back-end.
    We have aligned the code snippet to load the module only in the front-end, you can try this one:

    add_action( 'gdpr_modal_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 ); 
    add_action( 'gdpr_infobar_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_branding_styles_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_floating_button_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    
    function gdpr_cc_remove_hidden_elements( $html_content ) {
      if ( isset( $_GET['ct_builder'] ) || is_admin() ) :
      	$html_content = '';
      endif;
    	return $html_content;
    };

    Hope this helps.

    I have exactly the same issue with the GDPR Cookie Compliance dialog being shown in the Gutenberg editor when Oxygen is installed. It seems to be related to the Oxygen Gutenberg Integration plugin as when I deactivate that, the GDPR Cookie Compliance dialog no longer shows up in Gutenberg.

    I have tried the code snippet above but it seems that it doesn’t work as long as the Oxygen Gutenberg Integration is activated. Any thoughts as to what else can be done?

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @cordschneider,

    Thanks for the details.

    We suggest contacting the Oxygen Gutenberg Integration support team to help with the issue.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[bug] Cookie modal in Gutenberg with Oxygen Builder’ is closed to new replies.