Current Features-7.x-2.x-dev version fails to export menu link language information if it exists.

1. i18n_menu_query_features_menu_link_alter() function in i18n_menu module tries to alter queries with features_menu_link tag in order to add language related fields to menu links:

/**
 * Implements hook_query_TAG_alter() for features_menu_links.
 * Add needed fields to properly serialize localization information.
 */
function i18n_menu_query_features_menu_link_alter($query) {
  $query->fields('menu_links', array('language', 'customized'));
}

This alter function exists because it is presumed that features_menu_link_load() function in Features module attaches features_menu_link tag to the query that loads the menu link so that langauge related fields can be added to the exported code.

2. features_menu_link_load() function indeed attached features_menu_link tag to menu link loading query but with commit afa9133 this functionality is lost no apparent reason (see the diff, search for "addTag('features_menu_link')").

3. Solution: attach the tag back to the menu link loading query.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maijs’s picture

Status: Active » Needs review
FileSize
608 bytes

A patch against HEAD is attached.

FreekVR’s picture

I can confirm that this issue exists. This patch also fixes said issue. I am hestitant to set this to RTBC however as I am unsure whether the query tag was intentionally removed?

maijs’s picture

Commit message indeed does not state that it also contains a patch from issue #927566. It seems to me that the patch that removed ->addTag('features_menu_link') statement did so unintentionally as nothing in the changed code in the patch suggests that addTag() was in conflict with the proposed logic. Besides, addTag() simply provides a way for other modules to alter the query.

Norberto Ostallo’s picture

Status: Needs review » Closed (duplicate)

I confirm the patch is working, but this issue is a duplicate of #1931512: Supporting extra menu_links attributes, which have already been committed.