When inserting a new Image in the WYSIWYG via the Media button, you are asked for alt/title fields twice. When later editing the inserted Image (by selecting the image and clicking the Media button), you are only able to edit the second alt/title fields.
But, unfortunately, the second set of alt/title fields appear to be completely ignored!
The UI leads the user to think that the first set is attached to the File entity itself (since they are only asked when uploading a new image), and that the second set is the title/alt that will specifically get used for this inserted image (since they can change this later by editing the inserted entity).
However, the reverse is actually the case! The second set of alt/title fields are actually fields that Media is adding to the File entity (ie. field_file_image_alt_text and field_file_image_title_text). So, these will never get used because they are overridden by the first set. :-/
This whole situation needs to get cleaned up:
- There should be some way to edit the alt/title that get used AFTER it has already been inserted
- What the different sets alt/title are used for needs to be clearified (or maybe reduced to a single set, if we can't make it work sanely)
Comments
Comment #1
dsnopekI haven't dug too deep yet, but this issue might be related: #2170759: File fields that use WYSIWYG instead of plain text don't get updated.UPDATE: No, I don't think that's related after all.
Comment #2
dsnopekComment #3
dsnopekI applied a re-roll of this patch and I think it fixed this: #2126697-21: Wysiwyg -- Alt and Title fields require some special handling.
Still need to do more testing - I was actually hoping that patch would fix a totally different issue. ;-)
Comment #4
dsnopekActually, it turns out that the patch I found in #3 wasn't actually fixing the issue. It was the latest commit on the Media 7.x-2.x git that did it:
http://cgit.drupalcode.org/media/commit/?id=63824297d512b1993d4448eb851d...
Comment #6
dsnopekUpdated Media to fix this issue! Let's see what Travis-CI says:
https://travis-ci.org/panopoly/panopoly/builds/30660397
Comment #7
dsnopekBlergh! Further testing shows that that patch actually IS necessary. :-/ Wow, testing this stuff is hard! Here is an issue to write some automated tests:
#2308325: Write Behat test for alt/title text on images in the WYSIWYG
Comment #8
dsnopekAdded this patch #2126697-27: Wysiwyg -- Alt and Title fields require some special handling..
Hopefully, this will be the end of this! Let's see what Travis says:
https://travis-ci.org/panopoly/panopoly/builds/30663266