[error] [client 10.191.96.42] PHP Fatal error: require_once(): Failed opening required '/var/aegir/platforms/wcg-d7-14/sites/all/modules/workbench_access/modules/i18n_taxonomy.pages.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/aegir/platforms/wcg-d7-14/includes/menu.inc on line 514, referer: http://dev.website.com/node/add/wcg-speech

I have a form with two taxonomy fields: one uses the select list widget and is also the access field for workbench_access, the other is for a tagging vocab and uses the core taxonomy autocomplete widget.

The autocomplete widget tries to include i18n_taxonomy.pages.inc from sites/all/modules/workbench_access/modules instead of from i18n. I'm on a deadline so I've simply symlinked the file in from i18n.

Workbench_access should not be changing autocomplete paths for taxonomy fields that are not associated with it. The override of taxonomy/autocomplete appears to be happening in workbench_access_menu_alter() (workbench_access.module:131).

CommentFileSizeAuthor
#4 i18n_taxonomy_autocomplete.patch1.04 KBjose reyero

Comments

agentrickard’s picture

Project: Workbench Access » Internationalization
Component: Code » Taxonomy

We change the autocomplete so we can filter the results properly.

But I see the problem -- workbench_access_menu_alter() applies to all autocomplete callbacks, regardless of the setting.

This bug is actually in i18n, which incorrectly alters the file name but not the file path of the autocomplete. i18n_taxonomy needs the following code in i18n_taxonomy_menu_alter():

$items['taxonomy/autocomplete']['file path'] = drupal_get_path('module', '18n_taxonomy');

However, the two modules may need to coordinate on how to enable both to function properly. At the moment, i18n_taxonomy will not properly restrict the results of the query based on user access rules.

agentrickard’s picture

Note that given Drupal's autocomplete architecture, there is no way to *not* change the autocomplete callback for all widgets, unless perhaps we sniff the #autocomplete path in a form_alter.

I would advise fixing the menu_alter in i18n, and opening a new issue where we figure out if/how both modules can intervene.

If that fails, we can open a new issue to change the way #autocomplete is applied by Workbench Access.

agentrickard’s picture

Also note that the use of 'module' by i18n is (apparently) an undocumented feature of hook_menu().

jose reyero’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

This patch should fix the issue, as suggested by @agentrickard

(Right, 'module' is not documented for hook_menu so we should be using 'file path' instead)

About

At the moment, i18n_taxonomy will not properly restrict the results of the query based on user access rules.

It does, since it adds the 'term access' tag to the query.

jose reyero’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Add the actual error message.