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.

CommentFileSizeAuthor
#1 flexinode_access.patch.txt915 bytesufku

Comments

ufku’s picture

Status: Active » Needs review
StatusFileSize
new915 bytes

here is a patch for access function.

Bèr Kessels’s picture

Component: Code » flexinode.module (core)

We 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

Bèr Kessels’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Tested and reviewed the patch.
It needs an upgrade path.
Now, no upgrades, people loose their permissions.

Bèr Kessels’s picture

A typo in the last update. It should have been:
Now, on upgrades, people loose their permissions.