Problem/Motivation
Background
With the following modules enabled on a clean build:
* Entity
* Media entity
* Media entity image
* Embed
* Entity Embed
* Entity Browser
* Ctools
And entity browser set up (otherwise successfully) using this tutorial:
https://www.webwash.net/manage-media-assets-drupal-8/
Attached to this image is a config sync folder that could be used to replicate the site with drush site-install --config-dir=...
Steps to repeat
With media bundles etc. in place as per the tutorial or the sync folder provided:
1. Upload an image (A) via media/add/image : title is configurable; file is stored on field_media_file.
2. Create content at node/add/page
3. Press rich-text entity embed button
4. Select the "Select" tab in the iframe
5. Embed image A, no caption included.
6. Select the "Upload" tab in the iframe
7. Upload an image (B) via the widget: title is set to the image's filename; file is stored on field_media_file.
8. Embed image B, no caption included.
9. View source.
What I see
* Image A is present with a title attribute
* Image B is present without a title attribute
Example (whitespace added for clarity):
<article class="embedded-entity"> <img src="/sites/mediatest/files/2017-08/streptocarpus_katie.jpg" width="2048" height="1152" alt="Thumbnail" title="Added via media/add/image" typeof="foaf:Image" /> </article> <article class="embedded-entity"> <img src="/sites/mediatest/files/20969200_127909691170397_7471335914812211200_n.jpg" width="800" height="1000" alt="Thumbnail" typeof="foaf:Image" /> </article>
Editing image B and changing its media name to be something other than the filename makes no difference: the title attribute is still missing.
Furthermore:
* Both attached files look the same at admin/content/files
* Both media items look the same (as far as I can tell, but there could be - should be? - a database difference)
* The alt="Thumbnail" on both images is a separate issue for media_entity, I think. The difference between the two images is the problem.
This has accessibility implications: hence I've tagged it a11y and set the priority to "Major."
What I should see
* Both images should have title attributes.
Proposed resolution
* Diagnose why image media created via the Entity Browser upload widget is displaying differently
* Perhaps offer extra fields in the upload widget, so that the media name can be set (although editing that later makes no difference)
Remaining tasks
* Triage
* Other steps tbc.
User interface changes
tbc.
API changes
tbc.
Data model changes
tbc.
Comment | File | Size | Author |
---|---|---|---|
config-mediatest-local-2017-08-23-12-29.tar_.gz | 38.13 KB | jp.stacey |
Comments
Comment #2
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedNote added to description:
This has accessibility implications: hence I've tagged it a11y and set the priority to "Major."
Comment #3
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedFurther investigation: it looks like
thumbnail__title
is being set during media/add/image, but not by the upload widget; althoughthumbnail__alt
is always set:(Unhelpfully for accessibility-impaired visitors,
thumbnail__alt
is always set to "Thumbnail": but that's a separate issue across all media_entity, I think!)Comment #4
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedFurther information: the reason "Thumbnail" is set, but title isn't, probably arises from media_entity module's Media.php, around line 238 in ::preSave():
So that at least explains why "Thumbnail" always gets set, but title doesn't unless there's a label during Media::preSave().
Comment #5
mgiffordmoving from the "a11y" tag to "accessibility".