When trying to create a new product type for the Commerce module, I get dozens of the same errors after the final submit for adding any new fields for any new types.

Notice: Undefined variable: mod_name in permission_select_theme_user_admin_perm() (line 63 of C:\xampp\htdocs\commons73dev\profiles\commons\modules\contrib\permission_select\permission_select.module).

I should note that the perm select version is the re-rolled and patched version at #25 from http://drupal.org/node/914580

Also... Permissions filter is installed and working in parallel, and I've set the default administrator role as well - at admin/config/people/accounts - to get permissions ticked automagically. The last bit is where it's probably hanging up.

Despite the notice/error, the entries in the permissions list are created - but - they don't show as a ticked item for the selected admin user.

Comments

HumanTex’s picture

As a quick update... I've been working with other content types and modifying or adding field data, I'm getting the same notice messages - but as before - the edit/add succeeds with no ill affects that I've seen so far. Obviously the errors aren't confined to just Commerce content fields, or only when creating new content types.

Anonymous’s picture

same problem for me. Seems like as if a module had been deactivated and a permission for this module still present and causing this kind of notices.
I had this with RedHen module but doesn't seem to be a redhen question.

anybody’s picture

Confirming this issue.

pog21’s picture

I had a look at permission_select.module around line 62 and I noticed that mod_name is only assigned if $key is numeric. Moving the assignment to just before the condition seems to fix it. So it now looks something like this:

// ~ line 48
$mod_name = t($form['permission'][$key]['#id']);
    // Module name
    if (is_numeric($key)) {
      $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => array('module module_name'), 'id' => 'module-' . $mod_name, 'colspan' => count($form['role_names']['#value']) + 1);
    }

Please note that I don't know if this breaks anything else, as I haven't tested it much!

skribbz14’s picture

Thank you, pog21, comment #4 fixed this error for me. Has anyone else tried this and has anyone found any issues with this solution?

anybody’s picture

The solution works fine :)

Katrina B’s picture

By the way, this problem occurs with version 7.x-1.2 as well.

intrafusion’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new666 bytes

Patch attached to fix issue, can we get this tested and applied to the module?

dsuess’s picture

is this patch going to be addressed anytime soon or ever?? I don't like having custom patches running on live customer sites.
Current Version: 7.x-1.2

segi’s picture

StatusFileSize
new795 bytes

I checked the patch and I found one strange thing, why is necessary to translate the html ID name? I know this issue does not connect closely to issue, but we touch the same row, so I thought I fix issue in the same time.

alexgreyhead’s picture

The patch in #8 worked for me - thanks Intrafusion.