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.
When specifying allowed file extensions for images (i.e. changing it to only allow JPEGs), the displayed values on the node create form are incorrect.
This is what's displayed when uploading an image:
...
Allowed Extensions: jpg
Must be an JPEG, PNG or GIF image
...
I don't know why it still says PNG and GIF, but they shouldn't be there...
I'm using CCK v6.x-2.x-dev (2008-Oct-02) and Imagefield v6.x-3.0-alpha2.
Comments
Comment #1
mike_r1977 CreditAttribution: mike_r1977 commentedI can confirm this error. This is because imagefield calls a filefield function, where the values are hardcoded:
Comment #2
BWPanda CreditAttribution: BWPanda commentedMoving to the FileField issue queue.
File extensions displayed on node creation forms need to match the chosen extensions, not be hard-coded.
Comment #3
dopry CreditAttribution: dopry commented@mike_r1977: can you write a patch for it?
Comment #4
dixon_Is the function
filefield_validate_is_image_help()
necessary at all? It just duplicates information.Comment #5
dopry CreditAttribution: dopry commented@dixon_: I don't know... I just put it there for fun... why don't you read the code and tell us.
As for the help text... It's limited to what FileField will potentially support, but I agree it may be nice to pass some context into the help callbacks, but what am I going to do? implement cases for each possible file extension? any great ideas besides objections?
Comment #6
BWPanda CreditAttribution: BWPanda commentedI might have misunderstood what you're asking, but can't you just have some sort or array that lists the different file extensions, then loop through that for validation and help text display...?
Comment #7
quicksketchThis is corrected in #397578: Uncouple ImageField from FileField Custom Hooks. Marking postponed until that patch is committed.
Comment #8
quicksketchI went ahead and committed #397578: Uncouple ImageField from FileField Custom Hooks, there was too much held up by its changes.
Comment #9
quicksketch