I believe there is an error in the code as show title checkbox does not seem to do anything. In protected_node.redirect.inc line 85 and protected_node.fork.inc line 130 you have

    $node_title = variable_get('protected_node-'. $node->nid .'-show_title', FALSE);
    if ($node_title) {
      // embellish the title with double quotes
      $node_title = '"' . $node_title . '"';
    }

I believe it should be the following

    $node_title = $node->protected_node_show_title;
    if ($node_title == 1) {
      // embellish the title with double quotes
      $node_title = '"' . $node->title . '"';
    } else {
      $node_title = '';
    }

If I'm correct I can submit a patch.

Comments

jphelan’s picture

Here's a patch

jphelan’s picture

Also something worth considering. If you override the description then the checkbox does not do anything. So it might be worth displaying the title somewhere else rather than in the description, perhaps as a heading above the description.

jphelan’s picture

Status: Active » Needs review

BTW great module!

AlexisWilke’s picture

Status: Needs review » Fixed

jphelan,

Good catch. The TODO was actually saying that the variable needed to change with the $node parameter, but I guess at the time I moved the parameter to the node I completely forgot about the test in those two places.

Note that the protected_node_show_title variable is viewed as a Boolean, so the following was good enough:

    if ($node->protected_node_show_title) {
      // embellish the title with double quotes
      $node_title = '"' . $node->title . '"';
    }
    else {
      $node_title = '';
    }

Also it looks like the views were using the wrong word. I switch the "yes"/"no".

In regard to having the description overwriting the title, I use the token module to palliate. You can use something like [node:title] and get the title in the description. However, I agree that the interface does not reflect that...

Thank you.
Alexis Wilke

jphelan’s picture

Nice.

Yeah I was using token to start with which I think is what confused me, because the checkbox won't hide the title if you're using token. Not a big deal, and I'n not sure there's an easy solution other than finding and removing [node:title] if it's not checked, but that to could confuse people too if they're expecting it to be there and it is not.

Anyway, great module, thanks for you work!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.