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

Used attribute itemsJustification is not declared in block's schema #34003

Closed
3 tasks done
ntsekouras opened this issue Aug 11, 2021 · 0 comments · Fixed by #34493
Closed
3 tasks done

Used attribute itemsJustification is not declared in block's schema #34003

ntsekouras opened this issue Aug 11, 2021 · 0 comments · Fixed by #34493
Assignees
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@ntsekouras
Copy link
Contributor

ntsekouras commented Aug 11, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Have you tried deactivating all plugins except Gutenberg?

  • I have tested with all plugins deactivated.

Have you tried replicating the bug using a default theme e.g. Twenty Twenty?

  • I have tested with a default theme.

Description

In #28980 items justification was added to Social Links block. This PR though while started using a new attribute(itemsJustification) it was never declared in the block's schema(block.json).

Step-by-step reproduction instructions

  1. Insert a Social Links block and change the justification from the control.
  2. Save and reload
  3. Change again the value and observe that has both conflicting classes

Also check the blocks block.json file.

Expected Behavior

The attribute should be declared and a migration would be needed based on existing classes.

I would propose though to hold onto this a bit before fixing, as in this PR: #33987 there is exploration of using a flex layout for this block. If this PR lands we would need to remove the now missing attribute, so this issue will be resolved.

Current Behavior

What this means in practice is that the attribute is never saved. When we insert such a block the value is undefined so the default behavior felt okay (left align/flex-start). While editing this value by the corresponding control we were setting the value with setAttributes, which doesn't sanitize the attributes, and added a css class which was was then saved. On reload though, the same block seemed to be keeping its behavior by the css classname and not the attribute - the attribute is undefined. So if you change this value after reload a new css class will be applied that leads to multiple conflicting classes - there is only one winner though with unexpected results 😄 .

@ntsekouras ntsekouras added [Type] Bug An existing feature does not function as intended [Block] Social Affects the Social Block - used to display Social Media accounts labels Aug 11, 2021
@Mamaduka Mamaduka changed the title Used attribute itemsJustification` is not declared in block's schema Used attribute itemsJustification is not declared in block's schema Aug 11, 2021
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant