Hi
I am trying to upload multiple images with my node and if my form gets some server side validation error, then all my images getting VANISHED expect the first image.
Please help...
The steps to reproduce are:
- Minimal drupal install + MFW + Field UI
- Create a content type with a file field with unlimited cardinality.
- Go to the node add form of this content type.
- Add several files to the file field. Do not fill in the required Title.
- Submit the node.
- Validation fails, so fill in the Title. Submit again.
Result: Only the first file appears in the file list.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | multiupload_filefield_widget-All-files-vanished-2302665-14.patch | 2.35 KB | asghar |
| #13 | multiupload_filefield_widget-All-files-vanished-2302665-13.patch | 992 bytes | asghar |
Comments
Comment #1
seadil commentedI have the same issue!
When uploading more than 65 Images into an Image field (with Multiupload) a notice is being displayed:
Notice: Undefined index: display_field in mfw_field_widget_value() (line 140 of /home/site/public_html/site/sites/all/modules/multiupload_filefield_widget/multiupload_filefield_widget.field.inc).
After this deleting images is not anymore possible and there are no images being displayed in the node.
Is there a patch for it?
Comment #2
czigor commentedFor 65 images it works? If so this sounds like a server setting problem to me. Try increasing max_input_vars, max_file_uploads, post_max_size and max_file_uploads.
Comment #3
seadil commented@czigor I uploaded the images in Packets with 20 images in each of it. After uploading 70 images only 66 images are being displayed in the backend and no images are being displayed in the frontend. I can't even delete an image in the backend. The only possibility to remove the images it to delete the whole node.
Comment #4
czigor commentedYour form might have got too big. Try to increase the php.ini max_input_vars directive.
Comment #5
seadil commented@czigor Thank you! I've overwritten the max_input_vars directive in the htaccess file.
.htaccess:
php_value max_input_vars 5000
Comment #6
czigor commentedDid it help?
Comment #7
seadil commentedYes, it worked.
But after 300 images I get this AJAX error message:
Eine AJAX-Anfrage ist abnormal beendet worden.
Im Folgenden finden Sie Debugging-Informationen.
Pfad: /de/file/ajax/field_event_gallery/und/form-FRBwDteypFKKYzYKwc-diYm7GSQPbcLphh7k4i38xlU
Statustext: n/a
Antworttext:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 60953 bytes) in /www/htdocs/customer/dev/www/includes/theme.inc on line 2017
ReadyState: undefined
Is there a way to solve this problem without increasing the max memore size?
Comment #8
esolitosHi seadil, yes you can increase the memory with a php.ini setting:memory_limit
Thake a look to this article: https://www.drupal.org/node/29268
Comment #9
irfworld commented@czigor
My issue is not with max_input_vars, max_file_uploads, post_max_size and max_file_uploads.
All images getting vanished as my form gets some server side validation error, Only first image remains there.
Steps to reproduce the same :
1. Go to your form.(your form must have some field on which you have put some server side validation e.g. Required).
2. Add some images in the image field.
3. Leave some required field BLANK, so that we can get the validation error.
4. Hit the submit button.
Comment #10
moertle commentedSame issue here.
It occours also if the dimension requirements are not valid for an image.
Comment #11
czigor commentedThis is actually a MFW issue.
The steps to reproduce are:
Result: Only the first file appears in the file list.
Comment #12
virgilro commentedHello,
Any updates with a fix for this issue?
Comment #13
asghar commentedHi,
I have attached the short solution to fix this issue. Please apply the patch.
Comment #14
asghar commentedHi @all,
I have debuged the issue. We cannot use form_set_error in submission process. I have updated the previous patch.
Comment #15
asghar commentedComment #16
lmeurs commented@asghar: Great catch, seems to work for me!
Comment #17
artemuss1990 commentedThat patch change only multiupload_imagefield_widget errors but error on any other field (eg node title field) that bug processing
Comment #19
vladimirausThank you all! Committed! 🍻
Comment #20
vladimiraus