Hi,

There are 4 languages enabled on our site, our default language is NL instead of EN.
When we clear our cache or when the workflow roles are rebuild (on save of a workflow entity) we get a notice:

Notice: Trying to get property of non-object in _workflow_rebuild_roles()

I noticed when we export the workflow using features (or workflow export) that my role names for system_roles are translated.
When the workflow roles are rebuild it tries to load the role by name, which obviously won't work because the role names are translated in the role map.
It also seems unnecessary to load each role, even if they are not in the role map...

CommentFileSizeAuthor
#1 workflow-rebuild-roles-2336709-1.patch597 bytesSandraVdv
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SandraVdv’s picture

I attached a patch to fix this problem.

johnv’s picture

Title: _workflow_rebuild_roles throws notice on multilingual site » [EXPORTING] _workflow_rebuild_roles throws notice on multilingual site
Component: Code » Features

The current implementation takes care if in the target system extra roles exists.
See this test case:
- On the source system, create your feature
- On the target sytem, add some additional roles, (not used in the source system) en import your feature.
- In the current situation, the roles are mapped OK. In your solution, it seems there is a problem.

I tend to consider this issue a "Won't fix", since the base language of source and target are not the same.

SandraVdv’s picture

It seems to me that it is better to just do a user_role_load() instead of a user_role_load_by_name() if we have the role id?

johnv’s picture

Status: Active » Closed (works as designed)

The mentioned functionality exports role names, to avoid problems importing into systems which have own role added, and thus having a mismatch between the numeric role id's. The Workflow module is renowned for solving this problematic issue.
When loading the role_names, they are not translated. It seems to me that you have not translated the role names, but changed them.