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.
As items are getting created many of them have the same weight, and many of the weights are out of scale. Almost every item is over the weight of 0. I have items with a weight of 167 being created, even when there are only 20 or so items in that parent category.
Weights on menu items should look more like this:
- -50
- -49
- -50
- -49
- -48
- -47
- -50
- -49
- -48
- -47
Instead once I actually load the menu I'll findsomething like this:
- -50
- -49
- 50
- 50
- 50
- 50
- -50
- -50
- 50
- 50
Comment | File | Size | Author |
---|---|---|---|
#4 | updateWeight.js_.patch | 2.69 KB | mcaden |
Comments
Comment #1
mcaden CreditAttribution: mcaden commentedI originally had this on Taxonomy menu but the more I looked into it, it's not taxonomy menu's fault, it's taxonomy manager which we're using to reorder the term order.
The weighting system is incompatible with Drupal's current method of weighting, which constrains weights between 50 and -50.
Comment #2
mcaden CreditAttribution: mcaden commentedHmm...I think this might do it.
In file: "updateWeight.js"
Replace Drupal.swapWeights with this one and add the two functions below it:
Comment #3
mcaden CreditAttribution: mcaden commentedComment #4
mcaden CreditAttribution: mcaden commentedIt appeared to work when I tested it, however there were a few things that would cause the above code to go extremely wrong. I've rewritten it and everything seems to function great.
The following patch is against 6.x-2.x-dev.
Comment #5
mcaden CreditAttribution: mcaden commentedComment #6
mcaden CreditAttribution: mcaden commentedComment #7
ivnish CreditAttribution: ivnish commented