#789556: Support taxonomy vocabularies seems to have introduced a recursion in 1.0-beta4, when trying to update an existing feature containing a taxonomy term reference field:

Fatal error: Maximum function nesting level of '100' reached, aborting! in /www/flow/htdocs/modules/field/field.info.inc on line 616

Call Stack:
0.0007 389212 1. {main}() /www/flow/tools/drush/drush.php:0
0.0191 2305640 2. drush_main() /www/flow/tools/drush/drush.php:41
4.1256 59409932 3. drush_dispatch() /www/flow/tools/drush/drush.php:101
4.1257 59410424 4. call_user_func_array() /www/flow/tools/drush/includes/command.inc:214
4.1257 59410676 5. drush_command() /www/flow/tools/drush/includes/command.inc:214
4.1260 59413956 6. _drush_invoke_args() /www/flow/tools/drush/includes/command.inc:806
4.1312 59445824 7. call_user_func_array() /www/flow/tools/drush/includes/command.inc:134
4.1312 59446088 8. drush_features_update() /www/flow/tools/drush/includes/command.inc:134
8.6543 80061688 9. _drush_features_export() /www/flow/htdocs/sites/all/modules/contrib/features/features.drush.inc:202
25.6361 108128452 10. features_populate() /www/flow/htdocs/sites/all/modules/contrib/features/features.drush.inc:278
25.6361 108131952 11. _features_populate() /www/flow/htdocs/sites/all/modules/contrib/features/features.export.inc:15
[...snip...]
25.7062 108331684 95. _features_populate() /www/flow/htdocs/sites/all/modules/contrib/features/features.export.inc:54
25.7068 108333164 96. drupal_alter() /www/flow/htdocs/sites/all/modules/contrib/features/features.export.inc:51
25.7068 108334088 97. field_collection_features_pipe_field_alter() /www/flow/htdocs/includes/module.inc:1004
25.7069 108334636 98. features_field_load() /www/flow/htdocs/sites/all/modules/contrib/field_collection/field_collection.module:1042
25.7069 108334912 99. field_info_field() /www/flow/htdocs/sites/all/modules/contrib/features/includes/features.field.inc:192

It seems that the vocabulary is added to the pipe by the taxonomy reference field in field_features_export(), and the subsequent call to taxonomy_features_export() adds the field back to the pipe...

Since the mapping for components isn't updated between entering recursion, _features_populate() doesn't recognize whether it has already processed a component or not.

Comments

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new1.67 KB

This patch implements a static cache of already processed component items to filter out any known items before entering recursion.

fangel’s picture

I'm fairly sure this is a regression - I had a feature with a term with a term-ref field, which worked just fine in -beta2.

But that patch works very well. The problem went away after applying.

However I think that perhaps a better way to do it, would be to avoid adding the fields in taxonomy_features_export if the field already exists in $export['features']['field']

-M

febbraro’s picture

Adding tag

jief’s picture

StatusFileSize
new1.59 KB

Rerol patch #1 for last 7.x-1.x-dev

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/features.export.incundefined
@@ -55,9 +56,20 @@ function _features_populate($pipe, &$export, $module_name = '') {
+        foreach ($more as $c => $d) {

$c and $d are terribly obfuscated variable names. Can they be a *bit* more verbose?

mpotter’s picture

Status: Needs work » Needs review
StatusFileSize
new1.67 KB

Here is an updated patch that improves the variable names.

markisatacomputer’s picture

I'm using 7.x-1.x-beta4 and patch in comment 1 works for me

drupalexio’s picture

Status: Needs review » Reviewed & tested by the community

I'm using 7.x-1.0-beta6 and the patch in comment #6 works great for me.

mpotter’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-1.0-dev

mpotter’s picture

Status: Fixed » Patch (to be ported)
mpotter’s picture

Removing v7 blocker tag

pwaterz’s picture

patch worked for me

hefox’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
pwaterz’s picture

Fyi this patch also works on 7

hefox’s picture

It's been commited to 7.x and should be in the dev version of it.

  • mpotter committed 6f73534 on 8.x-3.x
    Issue #1305194 by smk-ka,jief: Taxonomy reference field export recursion...
  • mpotter committed 82a8c17 on 8.x-3.x
    Issue #1305194 by hefox,Xen,mpotter: Provide support for exporting of...