Protected node includes some rather worrisome use of variable_get/set().

For example:

      if ($node->show_title) {
        variable_set('protected_node-'. $node->nid .'-show_title', TRUE );
      }

This is terrible misuse of the variables table. Worse yet, if the node is deleted these variables are not cleaned up. They're also not cleaned up if you uninstall the module.

These settings should be included as part of the protected_node table and all these variables should be cleaned up from the variables table.

Comments

AlexisWilke’s picture

Good catch. I wanted to change that as well since it doesn't make any sense to use a variable for such. (imagine that you create 100,000 nodes and all have a show_title flag... that's 100,000 variables!)

I added the necessary DELETE to the uninstall function, but I won't fix the node delete since I will instead get rid of those horrible variables.

Thank you.
Alexis

AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke
Status: Active » Fixed

Okay, the show_title is now fixed too. (along with many other problems that were in this module.)

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

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