Hi vingborg,
thx for this handy module!

However with todays (May, 21) muploader download from git i have two issues:

- only the last image is saved within the node. The add files area indicates all uploads are fine.
- style presets are not considered and warnings are given (see attached screenshot)

The nodetype configuration is:
- node with one image_field
- image_field with unlimited number
- image_field widget muploader

joerg

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joergM’s picture

hi vingborg,
after some more testing the behavior is:

1. first creation of a node with some uploaded images
- only the first image is saved
- the DB field_data_"my_image_field_name" is missing for the 2nd and the following images,
- the tables file_usage and file_managed are correctly filled with image data
- after manually added entries in field_data_my_"image_field_name" shows everything is fine
2. add some mor images to the node
- all images are saved correctly
- php warning '_weight' missing weight field

hope this helps bugfixing

joerg

JOINSO’s picture

Hi!

I have the same problems of pixelfraud.

I create a new ContentType with an File field, with unlimited number of values.
I upload several files and only the last image is saved.

Any idea?

Regards!

TripX’s picture

After my try, I have the following issues:

- At creation of node, only the first image is saved (edit and upload again is functioning)
- After reuploading some pictures, the node shows me 3 notices:

Notice: Undefined index: preview_image_style in image_field_widget_process() (line 347 .../modules/image/image.field.inc).
Notice: Undefined index: _weight in _field_sort_items_helper() (line 518 .../modules/field/field.module).
Notice: Undefined index: _weight in _field_sort_items_helper() (line 519 .../modules/field/field.module).

Michèle’s picture

I have the same problem as TripX.
The two _weight notices are repeated per newly updated image.

I had a few more problems as long as the image field was defined as a mandatory field - perhaps this is a hint for vingborg to fix this? Many thanks for your work!

Regards!

chx’s picture

Status: Active » Needs review
FileSize
1.83 KB

I wonder, does this help?

Michèle’s picture

Hi chx
Many thanks for your patch. You are right - it kills the _weight notice and I didn't find any negative side effects. :-)

But the problem that only the last image is saved is remaining.

Here is what I do:

- Create new node (containing an image field with mupload widget).
- Click on "Add files" --> select 5 images --> Start upload --> all seems to be fine
- Save node --> only the last of the 5 images appears (but I can find all five images in my target files directory).
- Click on edit node --> Notice: Undefined index: preview_image_style in image_field_widget_process() (line 346 ../modules/image/image.field.inc).
- Click on "Add files" --> select 5 other images --> Start upload --> all seems to be fine
- Save node --> all 6 images appear - but with the above mentioned notice.

When I click once again on the edit node link, I get this preview_image_style notice as many times as the count of uploaded images.

Could it be the case, that this problem is in conjunction with the colorbox module? (http://drupal.org/project/colorbox). But I have tried to use the colorbox module without the mupload widget and this works perfect...?

Edit: In the meantime I have also tried to use the mupload widget without colorbox and the same errors occur. So I think this has nothing to do with colorbox...

Many thanks to anybody who has a solution for this!
Regards
Michèle

Anonymous’s picture

Module simply doesn't work. Only last image is saved. On editing a gallery, I get:

Notice: Undefined index: preview_image_style in image_field_widget_process() (Zeile 346 von /var/www/vhosts/123.de/httpdocs/modules/image/image.field.inc).
Anonymous’s picture

After editing the failed gallery, and then re-adding my images, it works. But there are a lot of errors:

    Notice: Undefined index: preview_image_style in image_field_widget_process() (Zeile 346 von /var/www/vhosts/123.de/httpdocs/modules/image/image.field.inc).
    Notice: Undefined index: _weight in _field_sort_items_helper() (Zeile 517 von /var/www/vhosts/123.de/httpdocs/modules/field/field.module).
-- lots of repeat cut to keep the issue shorter
    Warning: usort(): Array was modified by the user comparison function in _field_sort_items() (Zeile 502 von /var/www/vhosts/123.de/httpdocs/modules/field/field.module).
Michèle’s picture

@morningtime: you have to apply the patch of #5 to get rid of the _weight notices.

Anonymous’s picture

Oh, thanks, it does work. It's a great module, just need to try twice to get it to work. I use this with the http://drupal.org/project/galleryformatter module to create instant jQuery galleries with Colorbox.

vingborg’s picture

Status: Needs review » Fixed

I have applied the patch by chx, and a lot of stuff seems to have evaporated :-)

All that code was simply not doing anything usefull.

dark11star’s picture

Is there a fix for the "only last image uploaded" problem? I have the same problem. One note, if I click "preview" and then save, it loads all images.

One other minor issue: WIth Firefox, the add files link does not launch a select browser like it does in IE. Is this a Plupload issue?

Thanks for all the work,
Jason

TripX’s picture

Jason,
as mentioned in another issue, this has nothing to do with muploader.
There is a fix for plupload integration module: http://drupal.org/node/1140666#comment-4402928

Michèle’s picture

Hi

I think I have figured out why these notices appear:
Notice: Undefined index: preview_image_style in image_field_widget_process() (line 346 of modules/image/image.field.inc).

It seems that an entry in the field_config_instance is missing, if the minimal drupal profile is installed instead of the standard profile! If you unserialize the content of the "data" field of used image-field, you can see that the element with the key "preview_image_style" and the value "thumbnail" is missing inside of data['widget']['settings'].

After manually inserting this array element in the database, all these notices disappeared!

(I used the following code

$instance_data = db_query("SELECT * FROM field_config_instance WHERE id = 10");
foreach ($instance_data as $instance_data_row) {
  $unserialized = unserialize($instance_data_row->data);
  $unserialized['widget']['settings']['preview_image_style'] = 'thumbnail';
  $serialized = serialize($unserialized);
  echo 'serialized: '. $serialized;
}

to get the updated serialized string and updated the database manually.)

Regards, Michèle

Anonymous’s picture

Status: Fixed » Active

The original problem is not fixed? Still only the last image is saved. (Only fails the first time, the second time you re-open and re-save the node, then it does work, as I described earlier.)

@TripX, the link you posted has a fix from April, but this thread started in May. I don't think your link has the solution to this problem (only last image saved).

@vingborg the patch you applied was not for the original problem? Still only last image is saved for new nodes.

Michèle’s picture

Hi morningtime

No, I do not think that the original problem is fixed - on my installation, the problem is remaining.
The patch which was linked by TripX only saves the problem "You must at least upload one file."...

Regards, Michèle

dark11star’s picture

The patch from #13 worked for me. It now uploads all files.

mdorman’s picture

Going to the link in #13 and applying the patch from #7 there fixed this for me. Also the chx patch fixed the weight problem as well.

monican’s picture

I have the same issue (only last image saved to node), but looking in the folder that images are uploaded to, all images are in fact uploaded, they just aren't attached to the node. Unfortunately re-saving the node did not work for me. I just keep getting the same issue. I'm also using colorbox and Gallery formatter.

My errors messages are different though and refer to plupload, so I posted over there as well http://drupal.org/node/1121070:
"Warning: unlink(C:\wamp\tmp\php41E1.tmp) [function.unlink]: Permission denied in plupload_handle_uploads() (line 345 of C:\wamp\www\campe\sites\all\modules\plupload\plupload.module)."
"Warning: Parameter 1 to imagecache_profiles_file_validate() expected to be a reference, value given in module_invoke_all() (line 819 of C:\wamp\www\campe\includes\module.inc)"
"Warning: implode() [function.implode]: Invalid arguments passed in form_error() (line 1593 of C:\wamp\www\campe\includes\form.inc)."

Thanks for your work on this vingborg! Its a fabulous module, and if I were any good at code I would try to help de-bug, but I'm willing to help any other way I can :)

JOINSO’s picture

I applied the patch from #13 and it doesn't work for me.

Also i get this erros when i go to media tab:

PHP Fatal error: Cannot access empty property in MY_SITE/modules/field/field.attach.inc on line 677, referer: http://MY_SITE/node/92
PHP Fatal error: Cannot access empty property in MY_SITE/modules/field/field.attach.inc on line 677, referer: http://MY_SITE/node/92

Perhaps is related to the not uploaded file....

Regards!

JOINSO’s picture

More info.....

The file are upload correctly, but only one file is displayed when editing the node.....

Any idea?

Regards!

Pavlos-1’s picture

Has anyone found a solution to this problem?

TripX’s picture

Actually no progress. The developer told me today that in the next couple of days there will be fixes for the actual problems.

Pavlos-1’s picture

Still nothing? :(

rv0’s picture

sub

joergM’s picture

subscribing

mat.’s picture

sub

daco’s picture

sub

derMatze’s picture

subscribing

robertom’s picture

Status: Active » Needs review
FileSize
846 bytes

this module is amazing ;)

I would attach a proposed patch for this issue

Frederic wbase’s picture

I have tested the patch from #30 and it works great!
Thanks for your work m8!

attiks’s picture

Status: Needs review » Reviewed & tested by the community

#30 works like a charm

rv0’s picture

yeah #30 rocks

can't believe it's that simple :)

RTBC: This should be committed and made into an official project imo... Where is vingborg?

Danny Englander’s picture

The patch in #30 worked in combination with http://drupal.org/node/1140666#comment-4402928

Pocketpain’s picture

Thanks #30!

sachbearbeiter’s picture

subscribe

pio.fernandes’s picture

Thanks #30!!!

Frederic wbase’s picture

vingborg? Commit to dev release?

mavimo’s picture

@all: patch into attachment is a collection of patch available on some different issues. It work fine with:

  • a large number of image (i test it with ~100 images to a total of 150Mb)
  • sort/remove image do not delete all image
  • work on multilinguage site

If anyone can test and confirm...

@vingborg: Thanks for your work! I think you can change this sandbox to a project. if you require some help on maintenance/test/.. please ask me ;)

Frederic wbase’s picture

@mavimo, i will test it in my next project, and post some feedback here. Thanks for your work :-)

EvanDonovan’s picture

It looks like #5 was committed to the repository; I am not sure about #39 - what is contained in it?

rv0’s picture

and a better question: Where is vingborg?

tomasbedrich’s picture

Priority: Normal » Major
Status: Reviewed & tested by the community » Closed (fixed)

Confirming: #39 works GREAT! Big thank to you @mavimo!
Just copy master from GIT and than apply patch #39.

mavimo’s picture

@ricoo tks :)

@vingborg: can I help you on mantain/improve this project? Can you let me know if is it possibile?

robertom’s picture

Status: Closed (fixed) » Reviewed & tested by the community

I'm wondering why this bug is marked as closed(fixed)... the patch isn't on git repository.

I reset this issues as RTBC (for patch #30)

@mavimo: I definitely will review your patch, but I think is better don't make a bulk patch...

#39 is splitted as:

#30 of #1164552: image upload: only the last image is save

#5 of #1182760: Respect Weights

#1 of #1313046: Add Insert support

and:

diff --git a/mupload.module b/mupload.module
index 324722c..1cf0635 100644
--- a/mupload.module
+++ b/mupload.module
@@ -223,12 +223,12 @@ function mupload_field_widget_value($element, $input = FALSE, &$form_state) {
  * Expands the mupload_file type to include the description and display fields.
  */
 function mupload_field_widget_process($element, &$form_state, &$form) {
+  $element = file_field_widget_process($element, $form_state, $form);
+
   if ($element['#media_type'] == 'image') {
-    return image_field_widget_process($element, $form_state, $form);
-  }
-  else {
-    return file_field_widget_process($element, $form_state, $form);
+    $element = image_field_widget_process($element, $form_state, $form);
   }
+  return $element;
 }
 
 /**

@mavimo what is the issue number of the last snippet of code? I haven't found it...

EDIT:

@mavimo what is the issue number of the last snippet of code? I haven't found it...

Ok... I've found it:

#12 of #1219854: When deleting image previously uploaded through widget, all other images are deleted

mavimo’s picture

@robertom: I mixed all patches becouse each single patch don't solve the problem without the other and some patch override some change on other. There's a list of step to do to have a working module, but it's also usefull for users have a "single" operation to do, without search all issue and apply each patch.

Thanks to report each issue/patch.

Ciao :)