Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice if there were fields for definable defaults for ALT and Title text as there is in the Drupal 6 version.
Is this something that you would implement or has a conscious decision been made to exclude it? I ask as I wouldn't want to waste my time looking at writing a patch if you specifically don't want the feature.
Comment | File | Size | Author |
---|---|---|---|
#14 | imagefield-5--2-406874-Default_ALT_Title_Text-2.patch | 5.44 KB | Deciphered |
#4 | imagefield-DRUPAL-5--2-406874-Default_ALT_Title_Text-1.patch | 5.37 KB | Deciphered |
Comments
Comment #1
quicksketchNo, the D5 version doesn't include it simply because it was never implemented. The D5 version is now officially "maintenance only" so new features won't be added to it. If a patch were provided and the D6 upgrade path proven to work, I'd gladly accept a patch to provide a backport.
Comment #2
pribeh CreditAttribution: pribeh commentedbump. I'll help test.
Comment #3
Deciphered CreditAttribution: Deciphered commented@pribeh
Good to hear.
I'll try to get a patch up and running ASAP.
Comment #4
Deciphered CreditAttribution: Deciphered commentedPatch good to go.
Haven't tested the upgrade path yet, but core functionality seems to duplicate Drupal 6 version.
Comment #5
Deciphered CreditAttribution: Deciphered commentedTested an upgrade from D5 to D6 and it went through without an issue.
Comment #6
pribeh CreditAttribution: pribeh commentedCan't see anything yet after having applied the patch to the 5x-2.6 version. Excited to get this going though. Where should the alt text be showing up? Is it configurable yet in the "edit field"; does it show up when adding a post within the image fieldset?
Comment #7
Deciphered CreditAttribution: Deciphered commented@pribeh
In manage field there should be ALT Settings and Title Settings Collapsible fieldsets, as there is in the D6 version.
Comment #8
pribeh CreditAttribution: pribeh commentedWow,
Sorry Deciphered, I forgot to upgrade from D5.15 to 5.16. Upgrading fixed my issue.
Comment #9
pribeh CreditAttribution: pribeh commentedDeleting irrelevant post.
Comment #10
Deciphered CreditAttribution: Deciphered commented@pribeh
That particular support request/issue that you are having is not relevant to this particular patch, as if it's a problem now, it was a problem before.
Please make another issue for that.
I don't mean to be cold, but if this issue gets bogged up with irrelevant posts, this patch will never get reviewed/committed, and I'm relying on it for a Drupal 5 version of ImageField Tokens.
Cheers,
Deciphered.
Comment #11
realityloop#4 Patch applied cleanly RTBC
Comment #12
quicksketchCould anyone confirm, this looks like a problem when setting the value of the ALT field when custom alt is not enabled:
If custom alt is not enabled, $field['widget']['alt'] will be an empty string, so it will always set the ALT text to an empty string instead of the filename. The same problem exists for title. Neither of these things are particularly bad though, it just seems like unexpected behavior. #193887: Accessibility enhancements makes the valid point that ALT text should never be generated automatically, though I think it'd still make sense to set the title to the filename if custom titles are disabled.
Either way, the logic should be clarified. As it is now it looks like it should use the filename as the default, but if custom ALT or title is disabled, then the filename will never be shown, since $field['widget']['alt'] will be an empty string. Something like this would be more appropriate:
Comment #13
Deciphered CreditAttribution: Deciphered commentedDamn it, you're right. Rewriting patch.
Comment #14
Deciphered CreditAttribution: Deciphered commentedReworked the patch.
If custom Alt is empty it won't fill it, but if Custom Title is empty it will insert filename.
Comment #15
quicksketchWell, unfortunately I don't think this will ever be added. I'm no longer even touching 5.x these days, and the entire D5 version will be EOL in 4 months anyway.
Comment #16
Deciphered CreditAttribution: Deciphered commentedThat's fine, I myself will probably drop support for 5.x modules, if I ever have time to work on my modules again that is.