I updated a site with an older version of Media and File Entity, both to the latest dev. I did encounter an issue with running update.php, which is documented https://drupal.org/node/2065213 and resolved that.
But I no longer see ALT and TITLE tags on any of my images. Note that these aren't media_fields, just regular image fields. I do see the data being written to the database, but it doesn't get rendered to either the live site (in code) or on the admin/edit side of things (ALT field remains blank here)
I did see there's some talk of setting things up under file, "admin/structure/file-types/manage/image/file-display" but when I view that page on my site, the fields for ALT and TITLE are just missing. (see screenshot attached)
Any ideas on how I can fix this? I'm lost.
Comments
Comment #1
minneapolisdan commentedI found someone reporting a similar issue, https://drupal.org/node/2043499#comment-7749199
But no solution for me yet.
Comment #2
OriginalSauce commentedHi,
Looks like you tried the same things as myself to get them to come back.
Didn't find a solution to revealing the alt and title info again but I did find a work around which was rather laborious and time consuming but I now have it working.
Basically as I understand it, the latest upgrade to file entity moved the alt and title information out of the individual field data tables and moved them into the their own separate tables:
field_data_field_file_image_alt_text
field_data_field_file_image_title_text
Whatever happened during the upgrade process didn't automatically migrate the alt and title info to the new tables. As it didn't move them automatically, I thought perhaps it was meant to be triggered via the admin user.
I thought the file type migration at admin/structure/file-types/upgrade was what I needed to do. To be honest I wasn't sure what it did but it made some sense so I ran it. It came back with a very ungraceful error which was on it's own page (no website rendering).
The work around I found was to do the following.
For all content types change the image field widget from image to media file selector. Once I had set that up and did a few test node creations I could see the alt and title tags being updated successfully and were being stored in the new tables. More importantly the alt and title information was once again being displayed on the edit forms and being rendered on the website.
This was laborious as I had to do it manually but was made slightly easier as I brought up some old sql dumps and did some copy and pasting. I had spent pretty much a whole day trying to fix it and not wanting to waste any more time I went for the manual approach.
ps
Now I think about it, what I should have done was run some sql commands to migrate the data to the new tables, but by then I wasn't thinking straight enough.
Comment #3
devin carlson commentedI can confirm that file entity always loads alt and title text from the file itself instead of loading it from an image field (when available).
Unless we store all alt and title text in one place (à la #2012868: A better description for the alt and title attributes of images) I believe that image field alt and title text should be preferred and should fall back to file alt and title text if it's not available.
Comment #4
devin carlson commentedA patch to fall back to alt and title text on the file if it is not available on the entity itself.
Note that this depends on #2066275: file_field_load() overwites any field item properties with file entity properties to prefer the entity's alt and title text in the first place.
Comment #6
devin carlson commentedAccommodated the latest changes.
Comment #8
dave reidI think this is more what we need. Added a helper function to retrieve an array of field names by type since we need this in another area (updating image field dimensions). Also fixed that the value that should be set is actually on the entity's field value, not the file entity.
Comment #9
dave reidTested and confirmed this fixes alt and titles along with #2066275: file_field_load() overwites any field item properties with file entity properties
Comment #10
dave reidTested and committed #8 to 7.x-2.x. http://drupalcode.org/project/file_entity.git/commit/3dc863a
Now let's get some pressure to have #2066275: file_field_load() overwites any field item properties with file entity properties committed to core.
Comment #11
minneapolisdan commentedThanks for the help guys, I'm going try this out.
Comment #12
wimberb commentedI'm not sure if this is related to the issue discussed in this thread but it appears to be. Since updating to 7.x-2.0-alpha2 I have lost all ALT and TITLE tags from my site. The fields to enter ALT and TITLE are there but they are empty. I can add information to the fields but nothing is saved.
There does seem to be an exception though. Images uploaded through CKEditor still have their ALT and TITLE tags but they are gone from all other images.
Comment #13
devin carlson commented@wimberb You'll need to apply the patch in #1 of #2066275: file_field_load() overwites any field item properties with file entity properties or, since the patch has been committed, upgrade to the latest -dev release of Drupal 7. The alt + title text from any image fields is still there, it is simply getting wiped out by the alt + title text from the file itself.
We plan on making this suggestion more prominent (display it on the project page, etc) in the next few days. :)
Comment #14
wimberb commented@Devin. Thanks! That seems to have cleared up the problem.
Comment #15
OriginalSauce commentedFor me the latest patches didn't fix the issue with the alt and title tags showing up as blank or not updating (in the edit form) with a widget type set as image. If I updated the alt and title attributes via the file the changes would appear in the node edit form.
This isn't really an issue as I have now changed all but one of my content types to use the media file selector widget.
Going forward is this how new image fields should be defined?
Comment #16
stewestI'm using latest dev release 17 August. My alt and title's still not showing? Do I also need to apply the patch mentioned here https://drupal.org/node/2065507#comment-7768385 still ?
- UPDATE: Sorry, yes, applying CORE file module patch mentioned above does fix the issue!
Comment #17
lasseitorp commentedI'm still having the same issues with 7.x-2.x-dev from August 21.
Comment #18
OriginalSauce commentedDid you apply the patch the to the core file module, (file.field.inc)? found here
https://drupal.org/node/2066275#comment-7759503
comment #1
Comment #19
princiangi commentedYesterday i saw that no alt and title tags are displayed in my source code.
But as you described in the database they are still there.
anyone has a solution?
Comment #20
minneapolisdan commentedRead the posts above. You need the latest dev from File Entity and the latest dev from Drupal 7 to fix this.
Comment #22
stinky commentedI'm having the same problem. My Alt/Title fields from the Image entity have disappeared. I've applied the patch but this didn't fix the problem.
Comment #23
bneil commentedstinky - which patch did you apply? You need to update both file_entity and the Drupal core patch found at #2066275: file_field_load() overwites any field item properties with file entity properties in order for this to work.
Comment #24
stinky commentedThanks, I applied it to the core patch.
How do I apply it to file_entity ? Is there another patch somewhere?
The patch I found was just for the core file.field.inc file.
Thanks,
Stinky
Comment #25
minneapolisdan commentedStinky, at this point you'd only have to install the latest DEV of File Entity and it will work.
Comment #26
stinky commentedUpdating to the DEV of File Entity didn't help.
I have the following modules installed:
Media 7.x-2.0-alpha2
Media Browser Plus for Media 2.x 7.x-3.0-beta2
File Entity 7.x-2.0-alpha2+9-dev
I ran the patch on the core file.field.inc file.
Any ideas on how to get my Alt/Title fields back would be great.
Thanks.
P.S. Updating to Media dev version didn't help.
Comment #27
joelcollinsdc commented+1, not working with latest dev versions of drupal 7 + file entity. Reproducable using a clean install.
Update... the alt/title values do display (as long as token is enabled...), but the alt/title form fields still don't appear on the display settings form like they used to.
Comment #28
bneil commentedjoelcollinsdc: The alt/title form now lives at admin/config/media/file-settings instead of the file type's edit form.
Comment #29
emmonsaz commentedhttps://drupal.org/project/file_entity -- "Known Issues: If you are having problems with the alternate and title text fields when using image fields without the Media module widget, there is a core patch in #2066275-1: file_field_load() overwites any field item properties with file entity properties that will resolve it that hasn't been included in an official release yet. You should apply that patch to your core install.
https://drupal.org/node/2066275#comment-7759503
https://drupal.org/files/2066275-file-field-load-merge-order.patch
One line change and now alt/title works
Comment #30
devin carlson commentedStill fixed per #29.
Comment #31
rteijeiro commentedThis is not fixed yet. As @stinky commented in #26 it doesn't work with latest versions of media and media browser modules.
It also doesn't save the image alignment in rich editor.
Comment #32
bneil commentedrteijeiro:
Regarding alt/title, are you still referring to this original issue of regular image fields no longer having alt/title? Anything else is outside of the scope of this issue and I recommend filing a new issue.
All WYSIWYG fixes are being handled in the child issues of #2067063: Wysiwyg integration is broken.
Comment #33
jienckebd commentedIf this helps anyone else, on the file settings form at admin/config/media/file-settings, the default title token doesn't work with me. I had to change it to the below:
Original Token: [file:field_file_image_title_text]
Working Token: [file:field-file-image-title-text]
Comment #34
David_Rothstein commented