When using with a core image field type if the image fails validation due to image dimensions the validation failure message replaces the file browser link making it impossible to re-try. Furthermore, if there are multiple image fields with IMCE enabled on the form then once the validation message has been triggered by one field it will reappear on all other fields when a file is added or removed.

I don't know if it's possible to hook into the field validation via ajax to solve in a similar way to this issue https://drupal.org/node/1891850

thanks

Comments

ufku’s picture

How is it possible to get an image dimension error? Aren't images scaled down to fit the allowed size?

StephenN’s picture

That is true if validation is failed on maximum image dimension but not for minimum dimensions as you don't want to go upscaling an image as default.

ufku’s picture

Status: Active » Postponed (maintainer needs more info)

Ok I was able to generate the validation error but it didn't break anything. The widget is working as expected. Make sure it is not a conflict with another module. Also check if other validation errors(e.g. file size) cause the same issue.

StephenN’s picture

Sorry for the slow response.
Steps to reproduce.
1) setup a stock drupal minimal install with imce_filefield enabled.
I used the following drush commands;

drush site-install minimal --account-name=admin --account-pass=admin --db-url=mysql://root:root@127.0.0.1/d7_sandbox --site-name=sandbox -y
drush en imce_filefield -y
drush en field_ui
drush en image -y

2) Add a content type with 2 image fields. Aside from enabling imce_filefield keep all default settings. On one of these fields add minimum image dimensions.

3) Add a new node and attempt to attach an image via the imce browser that fails the minimum dimension requirements. You should see the result in the following screenshot where the file browser link is no longer accessible on the field.

4) As a secondary issue if you then (without refreshing) attempt to attach an image to the field without dimension restrictions the file will attach correctly but the previous error message will duplicate.

StephenN’s picture

Just worked out how to upload the screenshots for the issues above :)

kepesv’s picture

Same problem here

chapabu’s picture

Status: Postponed (maintainer needs more info) » Active

I get the same issue.

Following on from the extra provided information, can this have an eye cast over it again?

ufku’s picture

Status: Active » Fixed

Committed fixes for disappearing link and consistent error message

Thanks

Status: Fixed » Closed (fixed)

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