-
Notifications
You must be signed in to change notification settings - Fork 818
Tiled Gallery: Fix block validation issues caused by attribute removals #43345
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
base: trunk
Are you sure you want to change the base?
Tiled Gallery: Fix block validation issues caused by attribute removals #43345
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 3 files.
12 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
be38926
to
f53ea90
Compare
1ae79c1
to
f4bc02f
Compare
…n appropriate - conditionally
… and previous changes
…ple sites, so that images continue to display on AMP displayed pages when AMP is active
… things work with data attributes
be5e8ce
to
654a3f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for working on this, Karen 👍
I followed the testing intructions for multisites and everything works as described. I only have a question around using custom links in the Tiled Gallery with Carousel enabled:
Looks like we are never redirected to the specified link. We see the image in the Carousel instead. Just wanted to make sure if this is expected behaviour as I thought that by clicking on the image should redirect me to the corresponding custom link.


Thanks for testing @fgiannar !
Yes that's expected. Or rather, that's been the default behaviour as long as I'm aware, as it is also the case if you set the link to the attachment page or media file. In that case it will open up the Carousel if Carousel is enabled. That should be improved though - here is a related issue: #42097 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for all the additional info, appreciate it!
Tested on a JN multisite and a Simple site and everything works as described 🚢
Fixes several Tiled Gallery PRs:
#16514
#20756
#42104
#42119
(and others, mentioned in the main Linear issue, to be re-reviewed afterwards).
Related Linear issues: VULCAN-90 (and VULCAN-4, VULCAN-35, VULCAN-27)
Proposed changes:
data-amp-layout
andtabindex
was being removed from the HTML on Simple sites only (front-end), yet on subsites of multisites, when a Tiled Gallery block was added by a subsite admin, only thetabindex
was being removed. The new code includesdata-amp-layout
(needed if using the AMP plugin and viewing the page in AMP transitional mode), but only if the site is not Simple. It also removes thetabindex
(and while at it, the role and aria-label) - only to add them back via PHP on the front-end if Carousel is enabled.data-amp-layout
(as well asdata-custom-link
in this case) is due to code that strips outdata-
attributes, unless whitelisted. See this Linear link for related links: VULCAN-90tabindex
attribute is due to the usage of theunfiltered_html
capability on multisites - only superadmins will have that capability. Confirmed in testing by adding the capability back .data-amp-layout
attribute on Simple is that block validation issues in Tiled Galleries added within the Layout block are now not an issue, however layout issues then became visible. These have been fixed with changes in theresize.js
file and in the editor scss file (which then required some edits to meet currentsass-embedded
requirements).tabindex
from thegallery-image/save.js
in the v7 deprecation version, if the TG is being added by a non super-admin on a multisite network (or more realistically, anyone who doesn't haveunfiltered_html
capability on a multisite network - or any user role ifDISALLOW_UNFILTERED_HTML
is set to true inwp-config.php
).save.js
changes that ultimately had been problematic.Other information:
Jetpack product discussion
Relevant Slack conversation - p1747151379475959-slack-C05PV073SG3
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
On a self-hosted test site, with this PR applied (locally), or on a WoA or Jurassic Ninja test site with the Jetpack Beta tester plugin, and this PR applied. As a note, the reported issues predominantly affect Simple sites and multisites, so prioritize testing those (see further down):
/wp-admin/admin.php?page=jetpack#writing
).tabindex
of0
,role
ofbutton
, and anaria-label
. In the editor the image markup should not include anaria-label
,role
ortabindex
.tabindex
,aria-label
orrole
. If link is set to none, you won't be able to click on the images (it won't do anything). For any of the other link options, the link should work. There should still be noaria-label
,tabindex
orrole
- as the image is no longer the clickable element but instead is wrapped in an anchor tag./wp-admin/admin.php?page=jetpack#writing
- this should be enabled by default on Simple). On saving, there should be no block validation errors..aria-label
,tabindex
orrole
applied to images if Carousel is disabled - you may need make a minor change and re-save the post for this to apply though.Multisites:
?specialops=true#
), create a multisite, and within that multisite network create a subsite.Simple:
/wp-admin/options-media.php
)