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:

  1. Minimal drupal install + MFW + Field UI
  2. Create a content type with a file field with unlimited cardinality.
  3. Go to the node add form of this content type.
  4. Add several files to the file field. Do not fill in the required Title.
  5. Submit the node.
  6. Validation fails, so fill in the Title. Submit again.

Result: Only the first file appears in the file list.

Comments

seadil’s picture

I 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?

czigor’s picture

Priority: Critical » Normal
Status: Needs review » Active

For 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.

seadil’s picture

@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.

czigor’s picture

Your form might have got too big. Try to increase the php.ini max_input_vars directive.

seadil’s picture

@czigor Thank you! I've overwritten the max_input_vars directive in the htaccess file.
.htaccess:
php_value max_input_vars 5000

czigor’s picture

Did it help?

seadil’s picture

Yes, 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?

esolitos’s picture

Category: Bug report » Support request

Hi 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

irfworld’s picture

@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.

moertle’s picture

Same issue here.
It occours also if the dimension requirements are not valid for an image.

czigor’s picture

Project: Multiupload Imagefield Widget » Multiupload Filefield Widget
Version: 7.x-1.3 » 7.x-1.x-dev
Category: Support request » Bug report
Issue summary: View changes

This is actually a MFW issue.
The steps to reproduce are:

  1. Minimal drupal install + MFW + Field UI
  2. Create a content type with a file field with unlimited cardinality.
  3. Go to the node add form of this content type.
  4. Add several files to the file field. Do not fill in the required Title.
  5. Submit the node.
  6. Validation fails, so fill in the Title. Submit again.

Result: Only the first file appears in the file list.

virgilro’s picture

Hello,

Any updates with a fix for this issue?

asghar’s picture

Hi,

I have attached the short solution to fix this issue. Please apply the patch.

asghar’s picture

Hi @all,

I have debuged the issue. We cannot use form_set_error in submission process. I have updated the previous patch.

asghar’s picture

Status: Active » Needs review
lmeurs’s picture

Status: Needs review » Reviewed & tested by the community

@asghar: Great catch, seems to work for me!

artemuss1990’s picture

That patch change only multiupload_imagefield_widget errors but error on any other field (eg node title field) that bug processing

  • VladimirAus committed 633232e0 on 7.x-1.x authored by asghar
    Issue #2302665 by asghar, seadil, czigor, irfworld, esolitos, moertle,...
vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all! Committed! 🍻

vladimiraus’s picture

Status: Fixed » Closed (fixed)

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