When entering a node that had a weight of 0, it becomes -20 when entering node edit mode.

The attached patch works for me, however, I am not sure about the other call to _real_sticky2weight().

CommentFileSizeAuthor
weight-5.x-1.x.patch657 bytesyhager

Comments

quicksketch’s picture

Thanks, works for me!

elv’s picture

Great, works for me too. Just in time for a site I'm working on! Thanks.

stella’s picture

This works for me too. Is there anyone actively working on this project?

Mojah’s picture

All nodes created prior to installing node_weight will be set to -20 when edited. So this patch works for new nodes. Just remember to set old nodes to 0 or required weight when editing them.

pearcec’s picture

Patch works. Crucial. I updated the database for previous nodes to -100.

yhager’s picture

Status: Active » Needs review
treksler’s picture

hmm i had to use

      $node->node_weight = _real_sticky2weight($node->sticky) - 200;

also, any word on getting node weights added to core in a non hacky way?

andyschm’s picture

Priority: Normal » Critical

This patch for a critical bug has been in queue for 4 months. Does this module have an active maintainer?

harry slaughter’s picture

sounds like you didn't do the initial conversion of sticky field to weight conversion in admin/settings/weight/setup

harry slaughter’s picture

Status: Needs review » Closed (fixed)

fixed in weight 5.x-1.0

http://drupal.org/node/146436

rmpel’s picture

I had exactly the same problem as the people reporting it above

The solution is the conversion indeed.

Perhaps, for the dummies we are :P, this conversion should be done by an install function?

i have been thinking about this; you can safely convert every sticky 0 or 1 to -100 and 100 respectively providing the weight of nodes do not exceed 98
a non-sticky node with weight 100 would have weight 0
a sticky node with weight -99 would have weight 1
(that is, if I understood the function of the module correctly)
so if we never have stickies > 98 or < -98 the conversion of nodes can be done whenever one wants.

Ah well, just my thoughts on this issue.

Remon.

edit --

It looks I reinvented the wheel; i posted a bugreport 'some small bugs' implementing the same fixes as yhager's patch.

The latest development snapshot (which i downloaded today) did not have these fixes incorporated, so I uploaded the patch.

Also, the package liked to above does NOT fix all the bugs; the _real_sticky2weight function still needs if ($sticky) replaced by if ($sticky > 0) to be bugfree.

Issmt’s picture

Does this module have an active maintainer?