Problem/Motivation
Until #2982322: Mark missing embedded entities in WYSIWYG landed, embeds of missing entities ( were deleted) would result in a broken situation for both the content author and the content consumer.
In #2982322, some UI strings were introduced.
Over at #2940029-40: Add an input filter to display embedded Media entities, Drupal core accessibility maintainer @andrewmacpherson pointed out some accessibility concerns:
+ protected function renderMissingMedia() { + return [ + '#type' => 'html_tag', + '#tag' => 'img', + '#attributes' => [ + 'src' => file_url_transform_relative(file_create_url('core/modules/media/images/icons/no-thumbnail.png')), + 'width' => 180, + 'height' => 180, + 'alt' => $this->t('Deleted content encountered, site owner alerted.'),
Is this text alternative going to be presented publicly to a website visitor? The message here describes the inner working of the CMS, and governance process in the organization who runs it. A public visitor doesn't benefit from being told about this. In any case, "site owner alerted" is not conveyed by the image itself; we don't want to provide extra information to screen reader users which we haven't provided for a sighted user. Also "deleted" isn't the same as "missing".
This is a tricky situation to come up with alt text for. I'd suggest something simpler, like "missing image" or "broken image". This would be a more matter-of-fact statement, which doesn't say anything about the CMS or owner's processes. It would be good to tailor it to the media type ("image" or "video" instead of vague "content").
Proposed resolution
Implement Andrew's suggestions, because that'll improve the experience for everyone.
Remaining tasks
User interface changes
Improved alt
and title
attributes.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#7 | missing media.png | 20.41 KB | oknate |
#6 | 3063705-6.patch | 3.31 KB | Wim Leers |
| |||
#6 | interdiff.txt | 1.94 KB | Wim Leers |
#2 | 3063705-2.patch | 2.17 KB | Wim Leers |
|
Comments
Comment #2
Wim LeersComment #3
oknateWhat about this part?
Oh never mind. I see you did that. I was looking at the test where it says deleted content.
Could we get a non content example in the test?
Comment #4
Wim LeersI was gonna do that next. If you want to, you can do that instead :) I suggest
user
, since that entity type is already installed.Comment #5
oknateI can tonight, I’m away from my computer now. Unless you want to.
Comment #6
Wim LeersDone.
Comment #7
oknateRTBC, I don't see any issues.
Comment #9
Wim Leers🚢
Comment #11
Wim LeersUgh, I just realized I didn't credit @andrewmacpherson after creating this issue! 😞 So now he's not in the commit message. But I can still at least give him issue credit. Sorry, Andrew, and thanks again! 🙏