Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix gallery to image transform and inconsistent types used in gallery block #20084
Fixes gallery to image transforms that were broken because the gallery block inconsistently stores image ids sometimes as numbers, but other times as strings. They're set as numbers initially when a gallery is created, but then as strings when loading a post and an existing gallery block is parsed.
The image block expects them to be numbers, so transforming an existing gallery block to images caused invalid image blocks.
This PR tidies up the inconsistencies:
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
My feeling is this is non-breaking and doesn't require a block deprecation. Any existing galleries saved into posts will have their ids stored as strings in the data-id attribute. Every deprecation also stores ids this way. So setting the id
Having said that, we definitely need to test this on mobile and see if it is breaking anything. @mkevins will help you if any change is needed on
This looks good to me, and I appreciate the comments