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:

  1. There should be some way to edit the alt/title that get used AFTER it has already been inserted
  2. 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

dsnopek’s picture

I 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.

dsnopek’s picture

Issue summary: View changes
dsnopek’s picture

I 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. ;-)

dsnopek’s picture

Actually, 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...

  • dsnopek committed da9f39a on 7.x-1.x
    Update Panopoly Widgets for #2307007 by dsnopek: Fixed When inserting...
dsnopek’s picture

Status: Active » Fixed

Updated Media to fix this issue! Let's see what Travis-CI says:

https://travis-ci.org/panopoly/panopoly/builds/30660397

dsnopek’s picture

Status: Fixed » Needs work

Blergh! 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

dsnopek’s picture

Status: Needs work » Fixed

Added 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

  • dsnopek committed 29e9b15 on 7.x-1.x
    Update Panopoly Widgets for #2307007 by dsnopek: Fixed When inserting...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.