while building the menu(node/add/...), flexinode uses flexinode_content_types() function to get the original content type names and construct the user permission strings. however in flexinode_access, permission strings are constructed by using node_get_name() function which results in a semi-translated permission string since node_get_name returns the translated name of the node. to compare;
('create '. $ctype->name .' content') ?=? ('create '. node_get_name($node) .' content')
these two strings become different when content type name is translated.
I think, instead of node_get_name we should get the original name of the content type by $ctype=flexinode_load_content_type(substr($node->type, 10)) and use $ctype->name.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flexinode_access.patch.txt | 915 bytes | ufku |
Comments
Comment #1
ufku commentedhere is a patch for access function.
Comment #2
Bèr Kessels commentedWe deliberately changed the permission strings from internal names to translated names, so maybe we can find another way around this.
Related to this, is an issue I just opened against core: http://drupal.org/node/105590
A hack proposed on IRC:
[13:04] berkes, the "little" trick (ugly hack) would be to set permissions by node type, then hack into the form and set #value for $form['permission'][$perm] to t('the_action') . node_name
Comment #3
Bèr Kessels commentedTested and reviewed the patch.
It needs an upgrade path.
Now, no upgrades, people loose their permissions.
Comment #4
Bèr Kessels commentedA typo in the last update. It should have been:
Now, on upgrades, people loose their permissions.