Closed (fixed)
Project:
Features
Version:
6.x-1.0-beta5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2010 at 22:30 UTC
Updated:
20 Feb 2010 at 02:10 UTC
I created a feature whose info file looks like:
core = "6.x"
dependencies[] = "apachesolr"
dependencies[] = "apachesolr_search"
dependencies[] = "context"
description = "Apache Solr search brought to Atrium"
features[context][] = "atrium_apachesolr_search"
features[ctools][] = "context"
features[ctools][] = "variable"
features[variable][] = "apachesolr_cron_limit"
features[variable][] = "apachesolr_enabled_facets"
features[variable][] = "apachesolr_facet_missing"
features[variable][] = "apachesolr_failure"
features[variable][] = "apachesolr_host"
features[variable][] = "apachesolr_index_last"
features[variable][] = "apachesolr_index_updated"
features[variable][] = "apachesolr_last_optimize"
features[variable][] = "apachesolr_mlt_blocks"
features[variable][] = "apachesolr_path"
features[variable][] = "apachesolr_port"
features[variable][] = "apachesolr_read_only"
features[variable][] = "apachesolr_rows"
features[variable][] = "apachesolr_search_default_previous"
features[variable][] = "apachesolr_search_make_default"
features[variable][] = "apachesolr_search_spellcheck"
features[variable][] = "apachesolr_search_taxonomy_links"
features[variable][] = "apachesolr_search_taxonomy_previous"
features[variable][] = "apachesolr_set_nodeapi_messages"
features[variable][] = "apachesolr_site_hash"
name = "Atrium Apachesolr Search"
package = "Atrium"
project = "atrium_apachesolr_search"
version = "6.x-1.0"
Upon enabling the feature or visiting the feature recreate page I would experience two parse errors:
Parse error: syntax error, unexpected ';', expecting T_STRING or T_VARIABLE or '$' in /home/jskulski/public_html/project/sites/all/modules/contrib/features/features.export.inc(590) : eval()'d code on line 23
Parse error: syntax error, unexpected ';', expecting T_STRING or T_VARIABLE or '$' in /home/jskulski/public_html/project/sites/all/modules/contrib/features/features.export.inc(590) : eval()'d code on line 2</parse>
The export code for the respective code is
<code>
$export = array();
$context = new stdClass;
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'project_apachesolr_search';
$context->description = '';
$context->tag = 'Apache Solr Search';
$context->conditions = array(
'path' => array(
'values' => array(
'search/apachesolr_search/*' => 'search/apachesolr_search/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'apachesolr-sort' => array(
'module' => 'apachesolr',
'delta' => 'sort',
'region' => 'right',
'weight' => 0,
),
'apachesolr_search-type' => array(
'module' => 'apachesolr_search',
'delta' => 'type',
'region' => 'right',
'weight' => 1,
),
),
),
'debug' => array(
'debug' => 1,
),
);
$export['project_apachesolr_search'] = $context;
return $export;
and
function _project_apachesolr_search_strongarm() {
$export = array();
$strongarm = new stdClass;
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'apachesolr_cron_limit';
$strongarm->value = '50';
....
Which seems like it exports fine, but somehow fails to parse. I did a bit of digging and found when I var_dump $code from line 590 of features.export.inc
$cache[$module_name][$component] = isset($code[$default_hook]) ? eval($code[$default_hook]) : FALSE;
I find lines transformed from
$variable = new stdClass;
had been transformed to
$variable = new ;
which certainly would not parse, but I am not sure why the code is transformed.
Comments
Comment #1
yhahn commentedShould be fixed with http://drupal.org/cvs?commit=324864