I don't know if this would be considered a bug in node privacy byrole or in Drupal itself.

As soon as I installed this module and tried to set default permissions for a content type, I got 14 separate database errors upon submitting the content type settings form. Like this:
* user warning: Duplicate entry 'npbr_foredit_content_researcher_profile_default_' for key 1 query: INSERT INTO variable (name, value) VALUES ('npbr_foredit_content_researcher_profile_default_3', 'i:0;') in /public_html/includes/database.mysql.inc on line 121

The Drupal database schema only allows for values up to 48 characters in length in the variable.name field. That means that trying to set default permissions for any content type with a name longer than 17 characters will generate errors.

I found some general discussion of this issue here: http://drupal.org/node/62673

I chose to just alter the variable table to support longer names, but something needs to be done vis-a-vis this module -- if only warn users to use shorter names (not my idea of a real solution, but then I didn't create the problem with the Drupal DB schema / this module's variable naming conventions, however you want to look at it).

Pretty frustrating to install a module and have it broken (in more than one fundamental way -- http://drupal.org/node/50728) out of the box.

Comments

jondoesdrupal’s picture

Assigned: Unassigned » jondoesdrupal

I'll address this issue in the 5.x version.

deekayen’s picture

I'm assuming this bug is still relevant to 4.7.x, but in Drupal 5, the variable table allows 128 chars instead of just 48.

deekayen’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not really sure how to address this issue. Here are some of the solutions I see:

  1. Have the .install expand variable.name to 128 (what it is in Drupal 5 anyway).
  2. Turn the module off for long-named content types.
  3. Add a warning to the content type page mentioning the limitation. I'm thinking adding a drupal_set_message() and then form_set_error() instead of saving if the name is too long.

I'm inclined to pick the later since I don't know how a 128 change could impact the auto upgrade to Drupal 5 and turning the module off for long names seems more like a cop-out. How was your upgrade experience to Drupal 5 (if you did one) after you did the size change manually?

deekayen’s picture

Assigned: jondoesdrupal » Unassigned
Status: Postponed (maintainer needs more info) » Closed (won't fix)

after no response, I added docs about this issue to README.txt, and I'm marking it won't fix because I think the right solution is to make the column 128 characters, and I would much rather have the auto upgrade script to Drupal 5 not have the chance to trip up on that.