-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Mobile] Gallery "Link To -> Attachment Page" option not creating an anchor #23576
Comments
In debugging this a bit further, it seems that the absense of the For self-hosted sites, we do not have attachment page link in our media model, so we cannot pass it back to JS. To conform to more stringent specification, we did implement the generation of this value in the implementation of the gallery upload completion processor, which explains why the links work correctly for images that have completed uploading outside the editor. The endpoints used for which the media model is derived do not directly have the attachment page link (.com v1.1 and XMLRPC), though confusingly, the XMLRPC does have a "link" in the response which appears to be the equivalent to the "url" from the REST APIs, and not the same as the WP API "link". |
I also found this behavior when:
The "Media File" option gets an anchor but if you switch the option to "Attachment Page" and update the post, no anchor tag get generated and hence no link to the the attachment page. Emptied cache as well to ensure it's not a caching issue. |
This issue appears to now occur for both Media File and Attachment Page options. Selecting either option starting with WordPress apps 18.5 / Gutenberg Mobile v1.64.0 does not insert the expected anchor tag. It also is not specific to self-hosted sites, as it occurs on WordPress.com sites as well. |
In light of @dcalhoun 's findings (which I have also observed), I'm going to go ahead and add a "high" label to this since the flow of changing the link type seems to be completely broken across all sites. Feels like we need to either fix this or remove the "Link To" setting from mobile. FWIW, I noticed that if I take a gallery from web with valid Link To settings, and add an image to the gallery, the new image has no Link To behavior, but the pre-existing images in the gallery (originally added on web), still retain their previous Link To behavior. |
Describe the bug
The "Link To" setting for Gallery block is not working for the "Attachment Page" option.
To reproduce
Expected behavior
The images in the gallery should link to the respective attachment page
Smartphone (please complete the following information):
Additional context
This seems to primarily affect self-hosted sites, since .com sites appear to use a separate mechanism to display the images (via JS instead of an anchor).
In debugging this a bit, I discovered that this issue is not present for gallery images that have completed uploading while the editor is closed. The processor is adding the data-link attribute, which I believe is absent from the media upload object returned to the editor when completed while the editor is open.
The text was updated successfully, but these errors were encountered: