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.
I have a gallery node type and image node type implemented using the method described by lullabot. I have several galleries and lots of image nodes and want to use NG3... is there some sort of migration or can i choose pre existing node types upon installation/set up?
Thanks!
Comments
Comment #1
jjjames CreditAttribution: jjjames commentedI tried it and I can map existing node types, but seems that old images don't get included into the galleries? If I add a new image, it works. Any ideas?
thanks
Comment #2
scroogie CreditAttribution: scroogie commentedSo does the lullabot method create a node for every image, or does it attach multiple images to the same node?
To bulk assign images to galleries you can use VBO. Perhaps this thread helps: #984938: Migrate from Image Module galleries to Node Gallery/Imagefields
Comment #3
justintime CreditAttribution: justintime commentedjjjames - that, at the moment, isn't supported. Lullabot's famous blog post recommends the gallery be the node, and the images be attached to the gallery node as just imagefields, not separate nodes.
It's certainly not impossible to do, it would just require a script that this module's developers don't have time to write at the moment. This would be a great user contrib if someone would like to step up.
Comment #4
scroogie CreditAttribution: scroogie commentedJustin, what do you think about extracting some common code of these update scripts to facilitate migration. Perhaps we could have a function to create an image node from a fid or an image node from a filepath with the gallery id as additional parameter. We could take the code from plupload.module? That way people would only have to worry about retrieving the galleries and filepaths, not about our part of how to create stuff. It shouldn't be too much code, only respecting the default types and relationships, but it will probably make life easier for some people.
Comment #5
justintime CreditAttribution: justintime commentedIdeally, we could release a series of drush scripts to do this, but the reason I postponed is because the API's/functions are all in NG core to do this. We can add these scripts after release without risking introducing bugs in NG core. I also want to let this sit for a bit, because I have a feeling we'll be hitting a critical mass of NG3 awareness soon, and will likely start to have many requests to migrate.
Finally, once we hit 3.0 as a recommended release, the likelihood of a paid Drupal shop needing to write code for someone to do this is much greater, and they may contribute said code back to the project.
So, I guess what I'm saying, is that it *will* get done, but likely will wait until after 3.0 is the recommended version for a bit.
Comment #6
jjjames CreditAttribution: jjjames commentedIt creates a node for each image. This is the method:
http://www.lullabot.com/articles/photo-galleries-views-attach
Thanks
Comment #7
justintime CreditAttribution: justintime commented@jjjames - it creates a node for each *gallery*, but uses multiple imagefields attached to one gallery node to represent the images. One imagefield doesn't equal one node.
Comment #8
jjjames CreditAttribution: jjjames commentedHmm you sure? I guess I did it wrong then. I'm using a method where i have a gallery type and an image type. Each image = a node and has a node_ref field that points to the gallery.
Any idea how I could seamlessly implement NG3 and use my existing galleries and image nodes?
thanks!
Comment #9
justintime CreditAttribution: justintime commentedMy bad - there are separate node types associated with a nodereference field in that example. That's how views_gallery does it too.
I'd love to do this, but just don't have time right now. If you know someone who knows Drupal & PHP, here's the gist of what they need to do:
1) Create a relationship that associates the gallery type to the image type
2) node_load() and node_save() each gallery node. This will insert it into the node_gallery_galleries table.
3) node_load() each image node. Find out the nid of the parent gallery, and assign that to $node->gid. node_save() the image node. This will add the entry to the node_gallery_images table.
Pretty simple really, but I just don't have time right now.
Comment #10
jjjames CreditAttribution: jjjames commentedcool thanks! if i get some code i'll share it
Comment #11
Summit CreditAttribution: Summit commentedsubscribing, greetings, Martijn
Comment #12
zengenuity CreditAttribution: zengenuity commented