Skip to content
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

>=7.4.0: New bug: Missing classes for core/group block #20347

Closed
strarsis opened this issue Feb 21, 2020 · 4 comments
Closed

>=7.4.0: New bug: Missing classes for core/group block #20347

strarsis opened this issue Feb 21, 2020 · 4 comments
Labels
[Block] Group Affects the Group Block [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@strarsis
Copy link
Contributor

strarsis commented Feb 21, 2020

Describe the bug
Since release 7.4.0 of Gutenberg plugin (so 7.5.0 is also included) the DOM element of core/group block doesn't have classes anymore, notably for the selected block style (is-style-<block style name>. The classes are still correctly updated in the Advanced/Additional CSS Class(es) field.

To reproduce
Steps to reproduce the behavior:

  1. Install/update Gutenberg plugin 7.4.0 or higher (7.5.0).
  2. Open Gutenberg page editor, ensure the theme offers at least one non-default block style for the core/group block to be selected.
  3. Insert a new core/group block, to ensure no other markup is re-used from previous, correctly working Gutenberg releases, in order to reproduce this bug correctly.
  4. Select a block style for the core/group block.
  5. Inspect the element and notice that the DOM element for core/group blocks (with wp-block-group class) don't have any other classes assigned.
  6. Expand the Advanced pane, notice that the is-style-* class is correctly listed in the Additional CSS Class(es) field for that block.

Expected behavior
The classes should be applied to the DOM element of the core/group block as in releases of Gutenberg prior to 7.4.0.

Desktop (please complete the following information):

  • OS: Windows 10 Pro x64
  • Browser: Chrome
  • Version: Latest

Additional context
When the Gutenberg plugin is disabled (only WordPress core used) or downgraded to a release prior to 7.4.0, like 7.3.0, the issue goes away.

@swissspidy swissspidy added [Block] Group Affects the Group Block [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Feb 21, 2020
@jorgefilipecosta
Copy link
Member

Hi @strarsis,
I'm not being able to reproduce this issue.
I added the following code to the functions.php file of the currently enabled theme:

register_block_style(
    'core/group',
    array(
        'name'         => 'blue-group',
        'label'        => __( 'Blue Group' ),
        'inline_style' => '.wp-block-group.is-style-blue-group { background-color: blue; }',
    )
);

I verified a Blue Group style was available and I verified that the class is-style-blue-group was applied to the dom of the editor and to the dom in the frontend. The block gained a blue background as expected.

Could you provide additional details about your test website: plugins installed, the theme used, or any other information you may find relevant.
Thank you in advance!

@jorgefilipecosta jorgefilipecosta added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Testing Needs further testing to be confirmed. labels Feb 21, 2020
@strarsis
Copy link
Contributor Author

strarsis commented Feb 21, 2020

@jorgefilipecosta: The following code is used for registering a block style in theme on backend:

add_action( 'init', function() {
    if(!function_exists('register_block_style')) return;

    // Block styles

    // Group
    register_block_style('core/group', [
        'name'  => 'test',
        'label' => 'Test',
    ]);
});

The moment I update to Gutenberg >= 7.4.0 (and reload the editor page), the group styles disappear because they don't have a is-style-* classes anymore. When I downgrade to Gutenberg lower than 7.4.0, e.g. 7.3.0 (and reload the editor page), the styles are back because the group blocks have their is-style-* classes back.

WordPress version: 5.3.2 (latest)
PHP version: 7.4.2-fpm

Edit: Even when I use an empty dummy theme or extend an existing core theme, e.g. the Twenty Twenty theme and add the block style registration code above, the block style is listed for the core/group block, but when being selected, the core/group block is still missing the is-style-* class.

@talldan
Copy link
Contributor

talldan commented Feb 24, 2020

Hey @strarsis, thanks for reporting. This one was reported in #20140 and fixed by #20164. The fix will be in Gutenberg 7.6, which will be released this week.

@talldan talldan closed this as completed Feb 24, 2020
@talldan talldan added [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Feb 24, 2020
@strarsis
Copy link
Contributor Author

strarsis commented Feb 26, 2020

@talldan: I am really looking forward to the next Gutenberg release! 🐱
Currently, this issue is a blocker for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants