Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I wish I had this functionnality inside image_import module: the possibility to check an option that will copy the tree structure inside import folder to a Gallery/sub-galleries structure inside Drupal.
I didn't do anything yet, but I'm planning to start coding soon, and submit a patch quickly, to have your opinion.
Regards,
David
Comment | File | Size | Author |
---|---|---|---|
#48 | image_import_subgalleries.patch | 17.08 KB | David Stosik |
#16 | image_import_keep_tree.patch | 7.36 KB | David Stosik |
#4 | image_import_keep_tree.patch | 7.35 KB | David Stosik |
#2 | image_import_keeptree.patch | 4.89 KB | David Stosik |
#1 | image_import_keeptree.patch | 4.89 KB | David Stosik |
Comments
Comment #1
David Stosik CreditAttribution: David Stosik commentedHere it is!
Please tell me what do you think of it, and whether you found bugs, or not.
Comment #2
David Stosik CreditAttribution: David Stosik commentedSorry, previous patch was buggy.
This one is OK.
How this works: put some images inside files/images/import, using subfolders. For example:
Select a gallery (say, "containerGallery"), check the option "Reproduce folders structure with subgalleries", then click on "Import".
The following galleries will be created:
The images will go into corresponding galleries.
If anyone tests this, please give me your feedback.
Thanks,
David
Comment #3
Hetta CreditAttribution: Hetta commentedWhat an absolutetly splendid solution to all the various suggestions for tree structures!
Comment #4
David Stosik CreditAttribution: David Stosik commentedThank you very much! :)
Here is a new patch, to apply to original module. I corrected some bugs, and added the possibility to delete empty folders after import. :)
Comment #5
David Stosik CreditAttribution: David Stosik commentedAnybody here?
Comment #6
volunteermama CreditAttribution: volunteermama commentedpromising idea! Just what I need.
Comment #7
Hetta CreditAttribution: Hetta commentedYes - last time I tested 6.x things I didn't get anywhere, though. I'll give things another shot.
Comment #8
Hetta CreditAttribution: Hetta commentedLovely, works a treat!
What it does, though, is add image galleries which correspond to the import directories.
It doesn't replicate the directory structure in the /images/ folder on the hard drive ... bummer.
Comment #9
David Stosik CreditAttribution: David Stosik commentedThis would also be a great feature It thought about it, but didn't do anything. For now, I would like to see if this patch can be integrated into image_import module... ;)
Comment #10
doc2@drupalfr.org CreditAttribution: doc2@drupalfr.org commentedYes please!!! Keep an eye here by the way:
#103793: Add token support for image file directory and image names
If ever you could commit this to a 5.x version as well, that would be Sooooooo great!
Kind regards!
Comment #11
druvision CreditAttribution: druvision commentednice idea. Not ready for production yet.
Comment #12
Hetta CreditAttribution: Hetta commented?? The patch does exactly what it advertises: creates image galleries based on the file structure of the import folder.
How is this "not ready for production yet"?
Thanks ...
Comment #13
dman CreditAttribution: dman commentedYeah, what's the actual objection?
Some code formatting like a half dozen whitespaces is about the only issue I can see from looking at it (although I've not actually run the code ;-)
Comment #14
David Stosik CreditAttribution: David Stosik commentedDo you mean I should lighten my code with more whitespaces, or am I using them too much?
I also think this IS ready for production. My patch does clearly what I advertised, and as far as I tested, it doesn't introduce new bugs...
levavie, please be a little more explicit, what makes you think my patch needs work? If you don't tell me, I won't find by myself... :)
David
Comment #15
dman CreditAttribution: dman commentedTry using coder.module.
That'll tell you that "Drupal" expects
not
:-)
Totally trivial, but there you go.
That's about it I think (wherever you see it)
;-)
Comment #16
David Stosik CreditAttribution: David Stosik commentedI didn't know Drupal coding standards were so tight : I already contributed before, and had never been told my code was not compliant...
Hope this new version corrects the fault. :)
By the way, thanks for the coder module advice. It is very useful!
Comment #17
Hetta CreditAttribution: Hetta commentedOK, I can confirm that this patch still works a treat, no bugs, with importing images and displaying the resulting galleries.
(Image import says "# Created new gallery a-b." and "# Created new gallery c-e.", but it will import the images into existing galleries a-b and c-e without problems.)
Comment #18
David Stosik CreditAttribution: David Stosik commentedSo maybe there is a bug with my patch: I should display this message only when I really create the gallery.
Comment #19
Hetta CreditAttribution: Hetta commentedMy apologies, it did indeed create the folders it said it did - I'd forgotten one part of my gallery structure, on making folders in the import folder.
Tried again with the currently valid gallery structure on hard drive: everything works as advertised, including the correct "created gallery" message only on creating a new gallery.
It really is a lovely patch.
Comment #20
hover CreditAttribution: hover commentedHello, is it working with drupal 5.7?
Comment #21
David Stosik CreditAttribution: David Stosik commentedThis doesn't work for Drupal 5.7, as it is a patch of Drupal 6 version of the module...
Maybe I will develop a 5.x version if it is needed for my patch to be commited.
David
Comment #22
financialgeek CreditAttribution: financialgeek commentedI've been using this patch to import images in D6, works great! Thanks!
Comment #23
doc2@drupalfr.org CreditAttribution: doc2@drupalfr.org commentedI don't think this is necessary for you to make a 5.x version of your patch in order for your patch to be commited...
... but it might definately be interesting for many existing drupal sites already running under the 5.x release.
Comment #24
drewish CreditAttribution: drewish commentedlooks pretty good (i'd suggest proper sentence capitalization and punctuation on the comments but i won't hold up a patch on that count), the only thing that needs work is that the hook_uninstall() implementation should delete the variables.
Comment #25
David Stosik CreditAttribution: David Stosik commentedMy patch doesn't set any variable. So I don't see what should I delete in hook_uninstall...
Comment #26
drewish CreditAttribution: drewish commentedwhoops, my bad mis-read that...
Comment #27
YesCT CreditAttribution: YesCT commentedis this in the alpha release?
Comment #28
David Stosik CreditAttribution: David Stosik commentedSadly, I don't think so...
Comment #29
YesCT CreditAttribution: YesCT commentedi applied the patch to the 6.x-1.x-dev 2008-Apr-18 release and it worked great for the small test I did. I mean really beautiful, I had jpgs in folders, in folders, etc and it created galleries and subgalleries corresponding to my directories. Just perfect! I really hope this gets in a release. It is a huge usability / newbie friendly feature!
Comment #30
gresda CreditAttribution: gresda commentedSame comments, really good patch/addon !!
Thanks a lot
Comment #31
YesCT CreditAttribution: YesCT commentedWill this work with this http://drupal.org/node/103793 (naming of files/storing in the directory structure)?
Comment #32
YesCT CreditAttribution: YesCT commentedhttp://drupal.org/node/253631 seems to be related (the "hierarchical taxonomy mode, additionally sets the terms hierarchical relations to resemble the path structure" part).
Comment #33
David Stosik CreditAttribution: David Stosik commentedHello,
Here is a new version of my patch, applying to Image Import 6.x-1.x-dev. The only feature I added is to put a link to the gallery for message "Created gallery xxx", when import done.
The patch now applies to the file image_import.admin.inc (as code was migrated to this inc file).
As many people seem to be waiting for this feature, I put priority to critical.
Regards,
David
Edit: second time I can't upload a file to Drupal, so here is an external link: image_import_keep_tree.patch
Comment #34
David Stosik CreditAttribution: David Stosik commentedHello,
Any news?
Comment #35
David Stosik CreditAttribution: David Stosik commentedHello,
What's new?
Thanks,
David
Comment #36
David Stosik CreditAttribution: David Stosik commentedHello,
I would like to know if there's any chance my patch gets commited one day to image module. If yes, when could it be commited?
Comment #37
drewish CreditAttribution: drewish commentedi can't get to the patch. i'd like to see some other people testing out this patch.
Comment #38
Hetta CreditAttribution: Hetta commented"file not found" in French on the patch site ... sto: you can't upload a file with the same name as one that already exists. I suggest you upload to drupal as image_import_keep_tree-225014_39.patch (where "39" is the number of the comment in the thread ...)
Comment #39
David Stosik CreditAttribution: David Stosik commentedSure, it can't patch anymore, as the module lived since my last patch upload. I will try to upate it when I have time. Concerning the "uploading a file with the same name" problem, I don't think it's my problem, as I use standard image method, and did not change the way it upload images.
Regards,
David
Comment #40
bluemoon99 CreditAttribution: bluemoon99 commentedDoes the patch working fine with the version "6.x-1.x-dev 2009-Mar-23"?
Or what version should i use to apply the patch?
i am going to develop a photo site with several thousands images, it's painful if all the images are store into one folder..
Any help would be appreaciated!
Comment #41
DoctorWho CreditAttribution: DoctorWho commentedThe latest uploaded patch is not available any more. Could someone please upload the latest patch again?
Comment #42
jhofer CreditAttribution: jhofer commentedAny chance this will be updated David? This is a crucial patch for those of use dealing with complicated gallery structures. Thanks for your work and I hope you see this through until it is committed. (How do we help you get this committed by the way?)
Comment #43
rsommer CreditAttribution: rsommer commentedI'd like to have this patch updated too. Have to import 2700 Images at once. The Images are well structured in a folder hierarchy. But uploading every folder by itself would be horrible. I've searched about hours but found no solution for image_import 6.x-1.0-alpha5. And I would really like to use image module because everything else is working like a charm with this module.
Thanks in advance for every helping hint.
Comment #44
joachim CreditAttribution: joachim commented> (How do we help you get this committed by the way?)
Image 1.0 is getting released at DrupalCon, whatever state things are in. For this patch to go in, it needs to be rerolled against CVS HEAD and tested by at least one other person.
Anyone can reroll the patch against the current CVS HEAD. (well anyone with basic coding skills ;)
Comment #45
David Stosik CreditAttribution: David Stosik commentedMaybe I will be able to work on it before DrupalCon next week.
I will attend some conferences at the DrupalCon, maybe I'll be able to attend to the image module code sprint. ;)
First I'll have to find the latest patch I provided. ;)
Comment #46
joachim CreditAttribution: joachim commentedCool!
I'll keep this thread updated: http://paris2009.drupalcon.org/forum/image-10
Comment #47
David Stosik CreditAttribution: David Stosik commentedI did not find the last version of my patch, so I'll have to re-roll an older one, that's not a big issue...
But first, I will have to wait for a fix for the issue #450850: HTML code when try to import images... ;)
Comment #48
David Stosik CreditAttribution: David Stosik commentedHere it is. :)
Comment #49
joachim CreditAttribution: joachim commentedWorks perfectly!
Committed.
Thanks for your perseverance with this :)
Couple of minor things to note for future patches -- please roll them against the main module root (ie the image folder), and also avoid tweaks like the fixes to '!edit-link' on line 77. The latter are good, but should be in a separate issue so the patch is easier to read and understand. (Read webchick's post
Comment #50
David Stosik CreditAttribution: David Stosik commentedThanks !
How did the sprint go ?
Will there be a sprint on saturday ?
Comment #51
joachim CreditAttribution: joachim commentedI didn't find anyone else for sprinting yesterday and was hampered by lack of wifi.
The plan is to sprint saturday if there are people around -- Sat morning probably, watch the forum post and IRC.
Comment #52
David Stosik CreditAttribution: David Stosik commented\o/
Great ! I was not there yesterday (too much work), but will probably be there on Saturday. :)
Comment #53
joachim CreditAttribution: joachim commentedCool.
I'm joachim on IRC. Currently in the aegir session if you want to come say hello today.
Also -- sun, quicksketch, and I will be figuring stuff out after the imagefield session tomorrow.
Comment #54
asb CreditAttribution: asb commentedHi,
this addition is a very nice add-on to the image_import sub-module; I tried it on a quite fresh D6 site and imported a bunch (~ 1000) of images. After clicking through a sequence of import screens for about an hour, all the image nodes were created properly - very nicely done; there are not many working alternatives for bulk uploading images to a Drupal site at the moment, so this is a huge improvement!
But (sorry ;) - I couldn't access any of the newly created galleries or sub-galleries:
Access denied. You have no access permission for this page
. I'm User #1 and already tried to rebuild the Content access permissions at ./admin/content/node-settings without success. Basically nobody seems to be able to access the newly created galleries/taxonomy terms.Does anyone else experience this error with the recent image_module, or is this just another issue personally crafted fo me?
Thanks for this well done feature & greetings,
-asb
Comment #55
David Stosik CreditAttribution: David Stosik commentedAre you using other modules, such as Taxonomy Access Control ?
Last time I tried on a fresh install, it worked very well, and I was able to access the galleries...
Comment #56
asb CreditAttribution: asb commented> Are you using other modules, such as Taxonomy Access Control ?
Nope. But after some digging I think your patch is "not guilty", all older galleries seem to have become inaccessible, too (taxonomy term pages are displayed, image gallery pages based on taxonomy terms are inaccessible). Needs further investigation and requires probably a separate issue...
Edit: #571504: Galleries not working anymore
Greetings, -asb