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.
Hi!
I'm trying to migrate a bunch of content that is ordered by a numerical ranking. The Weight module seems to be exactly what I'm looking for, it's fairly mature and I cannot find support anywhere for it. It seems like a natural fit for Migrate Extras; think there'd be any interest? It would probably make a good field handler... Also, apologies if I should be asking in Weight's issue queue instead of here.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#6 | weight-migrate-support-1534484-6.patch | 1.62 KB | lee20 |
Comments
Comment #1
delta CreditAttribution: delta commentedyou can use the code in http://drupal.org/node/1626578#comment-6188036
Comment #2
mikeryanYes, the Weight module is the right place to ask.
Comment #3
aendra CreditAttribution: aendra commented@delta -- That's for physical weight; Weight module deals with item weighting in the sense "make this piece of content float higher in listings than that piece of content."
@mikeryan -- Good to know; thanks!
Comment #4
davisbenI'm not too familiar with the Migrate module and won't have the time to look into it for at least a few weeks. I'd be glad to review a patch if someone can come up with one.
Comment #5
mirsoft CreditAttribution: mirsoft commentedNot sure if it helps, but for some simple scenarios it simply helps to migrate the items into destination system in correct order (especially if you are migrating into clean system) by correct setting of ORDER BY source SQL query. Then, the nodes will be inserted into target system in desired order and you get the correct ordering if you add Node: ID to Weight view as second parameter to Weight: Weight.
Comment #5.0
mirsoft CreditAttribution: mirsoft commentedDerp, I meant "field handler" and not "destination handler".
Comment #6
lee20 CreditAttribution: lee20 commentedAttached is a patch which adds migrate support for weight. The calls to _weight_get_settings() may get heavy if your migrations have a lot of rows. I opened #2256799: Use static caching in _weight_get_settings() to deal with that.
Comment #7
lee20 CreditAttribution: lee20 commentedComment #9
davisbenCommitted. Thanks for the patch!
Comment #10
wieringen CreditAttribution: wieringen commentedI'm trying to do a migration from d7 to d7. After this patch I have a "weight" destination field. However there is no source field to map from.
Comment #12
Summit CreditAttribution: Summit commentedHi,
Does anybody have code how to migrate weight?
What are the source and destination fields please?
I have the destination fieldhandler...but no D6 source field to choose from within Migrate UI..
greetings, Martijn