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

Custom attributes for list block are lost when migrating from wordpress 5.5.1 to wordpress 6.1.1 #61457

Open
kmrmohit opened this issue May 7, 2024 · 1 comment
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended

Comments

@kmrmohit
Copy link

kmrmohit commented May 7, 2024

Description

When upgrading from wordpress 5.5.1 to wordpress 6.1.1, the custom attributes defined for list block in wordpress 5 are not retained while migrating the list block.

Step-by-step reproduction instructions

  1. Run wordpress 6.1.1
  2. Open the code editor and paste the below html created for wp5 list blocks
<!-- wp:list {"someCustomAttribute":["attrVal1","attrVal2]} -->
<ul><li>first</li><li>second</li></ul>
<!-- /wp:list -->
  1. Switch to visual editor and let wordpress create the blocks
  2. Open the code editor again and check for someCustomAttribute in the wp:list attributes,
    or open the console and execute below command
    wp.data.select('core/editor').getBlocks().attributes
    The code editor in wordpress 6 shows the below html and doesn't have the custom attribute anymore
<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>first</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>second</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

Screenshots, screen recording, code snippet

No response

Environment info

  • Wordpress 6.1.1
  • Gutenberg 14.3.1
  • Chrome Version 124.0.6367.119 (Official Build) (arm64)
  • macOS 14.3.1 (23D60)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kmrmohit kmrmohit added the [Type] Bug An existing feature does not function as intended label May 7, 2024
@kmrmohit
Copy link
Author

kmrmohit commented May 7, 2024

#45987

@Mamaduka Mamaduka added the [Block] List Affects the List Block label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants