Hello,
Good module
I've done a view which display the :
- node title
- node weight
sorted by node weight ASC, with the style weight changer
It works however nodes which have a default range (0 in my case) get the value -30 (weight range) with this display style.
It is a problem because others nodes which are normally displayed before, are displayed after.
Example :
Before displaying with weight changer (order by weight ASC)
- Node 1, weight -10
- Node 2, weight -9
- Node 3, weight -8
- Node 4, weight 0
- Node 5, weight 0
After displaying with weight changer (order by weight ASC)
- Node 4, weight -30
- Node 5, weight -30
- Node 1, weight -10
- Node 2, weight -9
- Node 3, weight -8
How to correct it in the module to keep the good default value and not replace it by the weight range.
Thanks for your help.
Comments
Comment #1
jose.guevara commentedSelinav:
Here is what I found in weight_handler_sort.inc It's crazy... It's been bugging me for two freaking hours... :
class weight_handler_sort extends views_handler_sort {
function query() {
$this->ensure_my_table();
// Reverse ASC and DESC for weight order so that the sticky weights are ordered like real weights.
if ($this->options['order'] == 'ASC') {
$this->options['order'] = 'DESC';
}
elseif ($this->options['order'] == 'DESC') {
$this->options['order'] = 'ASC';
}
$this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
}
}
Comment #2
davisbenI have committed a fix for this to 6.x-1.x.