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 Keep running into the issue of the weights not being picked up properly by a view. I've fixed the problem once by not using negative weight values but then, some time later, the new order seemed to stop working too.
Has anyone else had any similar problems?
Comments
Comment #1
davisbenI haven't run into any issues with negative weights. Could you provide a bit more info about whats happening/not happening.
Comment #2
_paul_meta CreditAttribution: _paul_meta commentedConfirming this issue for me too.
I have weight as a field in a view. I can drag the nodes around then save. Correct weight values are stored. But when trying to sort by those weight values it doesn't work, the order is kinda random. This occurs when weight is used as the first sort criteria in a view, both exposed and non-exposed sort mode.
Any help appreciated !
Comment #3
davisbenI was able to reproduce this when nodes that had not had a weight set were included in the view. If you add the Weight value field to the view these should show 0 as the weight. Is this what is happening for you?
Comment #4
davisbenI added an update hook to make sure all nodes of enabled types have a weight.