Hello - I'm a co-maintainer of the Node Gallery module. I'm neck deep in a refactor for our 3.x release, and needed to come up with a way to do bulk imports in our module. Your module looked like it fit the bill, and boy, did it ever.
A very simple 3 line modification was all that I had to do to your module, and one hook_form_FORM_ID_alter() in node_gallery was all that was needed to integrate the two.
The attached patch simply checks if the node_gallery module is enabled, and if so, pulls the gallery id off of the form values and adds it to the node just before saving.
Now, I have a tab named 'import' when viewing a gallery that when clicked will show your form, but will create the relationship between the image and it's gallery.
I would love it if you can commit my patch (or rework the code so it works otherwise). Let me know if there's anything I can do.
| Comment | File | Size | Author |
|---|---|---|---|
| imagefield_import_node_gallery.patch | 757 bytes | justintime |
Comments
Comment #1
kmontySubscribe
Comment #2
wulff commentedLooks good! I'll include this change in the next release of the module. (Which will happen in the beginning of March.)
Comment #3
justintime commentedJust some thinking out loud:
While this certainly works well for my module, it's not a very efficient patch in that every other module that wants to do the same thing will need it's own little "if" statement in a patch to your module.
Since hook_form_FORM_ID_alter() lets any module modify the data that eventually gets put into $form_state_values, it might be wise to do something like this (untested code):
That way, the data is placed on the node, and the outside module's nodeapi save function can handle it from there.
Thoughts?
Comment #4
wulff commentedThis has been fixed in version 1.9.
I have basically implemented the solution you suggested in #3.
Comment #6
crea commentedOh, ignore me. I thought this code had something to do with plupload.
Comment #7
crea commentedComment #8
crea commentedThis issue was referenced in the plupload module code. Very confusing