I believe that ever since I installed the Weight module, all nodes are forced "sticky". Even if I uncheck "sticky", a node is saved as sticky.

CommentFileSizeAuthor
#6 weight.module.patch664 bytesrstamm

Comments

Julien PHAM’s picture

I have the same problem with the cvs version... very disturbing...

moshe weitzman’s picture

Status: Active » Closed (works as designed)

yes, thats how it works. sorry. you will probably have to remove the syling in the theme for sticky since all nodes are sticky.

jjeff’s picture

Status: Closed (works as designed) » Active

I will look into this. The sticky flag should be set (or unset) during node load process. So while this problem may turn out to be unavoidable, it is not by design.

I'll see what I can do.

-Jeff

4p’s picture

Today I installed the weight.module v 1.12 and getting the same problem
After some investigation I found the '$node->sticky = (-1*$node->weight) + 100' and '$node->sticky = (-1*$node->weight) - 100' actions get applied twice so all nodes end up sticky.
I solved this by removing 'case 'validate':' on line 89 to fix the problem.
I don't know if the 'if ($_POST['op'] == t('Submit'))' check is needed for 4.6 under 4.7 it's not so I also removed line 91 and the closing bracket on line 112

  // case 'validate':
  case 'submit':
      //if ($_POST['op'] == t('Submit')) {      

        // non-weighted nodes have a weight of zero
        if (is_null($node->weight)){
          $node->weight = 0;
        }

        // here we're 'encoding' weight into the sticky value for the database

        // stickiness is the inverse of weight
        // - stickiness is sorted DESC while weight is sorted ASC
        //   so we invert the weight before saving...
        // if sticky box is checked, add 100 to weight
        // unweighted sticky nodes will have a value of 100
        if($node->sticky) {
          $node->sticky = (-1*$node->weight) + 100;
        }
        // unweighted non-sticky nodes will have a value of -100
        else {
          $node->sticky = (-1*$node->weight) - 100;
        }
      //}
      break;

Jos

4p’s picture

Title: All Nodes Are Sticky » All Nodes Are Sticky - fix
Status: Active » Needs review

Jos

rstamm’s picture

StatusFileSize
new664 bytes

This patch works fine on my drupal site.

alkhulaifi’s picture

I think there is no need to validate in this form operation. so by removing the validate case the module will work fine.

Max Bell’s picture

Nice catch. I wouldn't have noticed except that I couldn't seem to set a background color for stickies in my theme CSS that didn't change the background color of ALL my nodes, which led me to suspect I was going crazy...

harry slaughter’s picture

i don't see this behavior using weight v1.12 and drupal 4.7.3.

is this actually a 4.6 bug only?

harry slaughter’s picture

Status: Needs review » Closed (fixed)

This behavior does not exhibit in 4.7.2 using weight 1.12 - closing