If you change FALSE to TRUE in the following line:
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */

the component will be disabled initially but the feature will be in an overridden state. Is there a way to ignore this line while evaluating the status of a component?

Comments

mpotter’s picture

Did you revert the feature in the db, or was this on a fresh install of the feature to a new site? Unfortunately, once you start editing the export file by hand there isn't much Features can do to help you. Features uses a general API that modules like Context follow, so there is no way Features can make specific exceptions to specific fields for specific modules.

joachim’s picture

I'm setting this on D6.

> Unfortunately, once you start editing the export file by hand there isn't much Features can do to help you.

But my Context was initially disabled, and Features exported it as initially enabled! There's no other way to have its disabled status in the Feature.

Is this perhaps caused by Context not exporting the status of a context object?

joachim’s picture

Yup, that's the problem. Well, in CTools rather than Context.

In D6, this is the cause, in ctools_export_object()

  if ($schema['export']['can disable']) {
    $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . "\n";
  }

The object's status is not taken into account when that line of export code is written. I imagine the problem is the same in D7, as CTools is pretty similar on both 6 and 7.

alison’s picture

So is there anything we can do? I'm experiencing this problem now (using D7).

(and/or should we be carrying on with this in the ctools queue, @joachim ?)

claudiu.cristea’s picture

Project: Features » Chaos Tool Suite (ctools)
Version: 7.x-1.0-rc3 » 7.x-1.x-dev
Issue summary: View changes

Yes, it belongs to CTools.

claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new936 bytes

This should fix the false override.

claudiu.cristea’s picture

StatusFileSize
new1012 bytes

Better.

claudiu.cristea’s picture

StatusFileSize
new702 bytes
new1021 bytes

Avoid PHP notices.

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch in #8 to export.inc does not apply to the latest ctools 7.x-1.x-dev.

Checking patch includes/export.inc...
error: while searching for:
  $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . "();\n";

  if ($schema['export']['can disable']) {
    $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . "\n";
  }
  if (!empty($schema['export']['api']['current_version'])) {
    $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . ";\n";

error: patch failed: includes/export.inc:902
error: includes/export.inc: patch does not apply
yoftahe.addweb’s picture

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

@Chris, Please review my attached patch that rerolled for 7.x-1.x-dev, kindly review it.

Thanks!..

japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.