Hi

I try to export menu_links to existing feature

drush @t4 fe features_default_menu 'menu_links:main-menu:node/6'

And get error

Ambiguous component "main-menu", matches main-menu:http://t4.bashlov.ru/eyeglasses/gender/men-77, main-menu:node/31, main-menu:node/4, main-menu:node/22,            [error]
main-menu:node/13, main-menu:node/24, main-menu:node/15, main-menu:node/29, main-menu:node/27, main-menu:node/7, main-menu:node/3, main-menu:node/9,
main-menu:node/10, main-menu:node/30, main-menu:node/23, main-menu:node/21, main-menu:node/20, main-menu:node/6, main-menu:node/2, main-menu:node/18,
main-menu:node/26, main-menu:node/16
No components to add.    

I try to debug

--- features.drush.inc_orig	2012-03-19 14:08:06.000000000 +0400
+++ features.drush.inc	2012-03-19 14:08:33.000000000 +0400
@@ -322,6 +322,7 @@
         // pattern, check if one of the matches is equal to the pattern, and
         // use that, or error out.
         if (sizeof($matches) > 1 and $preg_component_pattern[0] != '^') {
+print $component_pattern;
           if (in_array($component_pattern, $matches)) {
             $matches = array($component_pattern);
           }

$component_pattern contain escaped hyphen (it's pattern of course!!)
main\-menu

and

if (in_array($component_pattern, $matches)) {

condition is always false

CommentFileSizeAuthor
#1 features-escaping-1489480-1.patch1.55 KBXen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xen’s picture

Status: Active » Needs review
FileSize
1.55 KB

Good catch.

Actually, the issue is the colon in the name. This patch should fix it.

Sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

Works as advertised. Thanks.

mpotter’s picture

Version: 7.x-1.0-rc1 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed and pushed ac04043.

  • mpotter committed ac04043 on 8.x-3.x
    Issue #1489480 by Xen | dema502: Fixed drush:features-export Ambiguous...