This morning I downloaded the most recent dev version and my feature remains overidden.

I had to install FE on an existing Installation with; Drupal 7.17 and features 7.x-2.0-beta1+5-dev

My local install shows the feature in default. Once I git pushed to my pantheon site, it remains overidden no matter how many times I select revert.

I cleared my cache before export and have cleared my cache on the remote site.

Here is my Screenshot of the code:
Features Export

Comments

kclarkson’s picture

Status: Active » Closed (duplicate)

Closing this so that the conversation can be focused here #1901116: Using exported blocks in installation profiles

kclarkson’s picture

Status: Closed (duplicate) » Active

Not a duplicate :)

pfrenssen’s picture

What are the differences between your local development environment and the Pantheon environment? Could you perhaps try to replicate this issue in a VM which has the same PHP version installed as you are using on Pantheon?

pfrenssen’s picture

Category: bug » support
kenorb’s picture

The same issue.

foo.features.fe_block_boxes.inc

/**
 * Implements hook_default_fe_block_boxes().
 */
function foo_default_fe_block_boxes() {
  $export = array();

  $fe_block_boxes = new stdClass();
  $fe_block_boxes->info = 'Workshop Login';
  $fe_block_boxes->format = 'full_html';
  $fe_block_boxes->machine_name = 'workshop_login_block';
  $fe_block_boxes->body = '<p><a title="Workshop login" href="/workshop/login">Workshop login</a></p>';

  $export['workshop_login_block'] = $fe_block_boxes;

  $fe_block_boxes = new stdClass();
  $fe_block_boxes->info = 'Workshop Logout';
  $fe_block_boxes->format = 'full_html';
  $fe_block_boxes->machine_name = 'workshop_logout';
  $fe_block_boxes->body = '<p><a title="Workshop login" href="/user/logout">Logout from Workshop</a></p>';

  $export['workshop_logout'] = $fe_block_boxes;

  return $export;
}

There are settings exported to foo.features.fe_block_settings.inc

And info file:

features[fe_block_boxes][] = workshop_login_block
features[fe_block_boxes][] = workshop_logout
features[fe_block_settings][] = block-workshop_login_block
features[fe_block_settings][] = block-workshop_logout

And it's not possible to revert these blocks. I've tried --force and clearing the cache.

kenorb’s picture

StatusFileSize
new62.04 KB

screenshot

kenorb’s picture

I think the problem was that the blocks didn't have uuid ids. I had to install UUID module.

rodrigoaguilera’s picture

Issue summary: View changes
StatusFileSize
new642 bytes

For me the problem was all the fe_block version code so I made a quick dirty patch to prevent to be writen on the feature

rodrigoaguilera’s picture

StatusFileSize
new1.27 KB

I had to remove more lines

pfrenssen’s picture

@rodrigoaguilera, that will probably break Features Extra. This version string is necessary to be able to revert and export blocks.

jstoller’s picture

StatusFileSize
new13.17 KB

I'm having this same problem on all my features with blocks. It's just the fe_block version that's keeping them overridden. I've tried doing a forced feature update, followed by a forced feature revert, but it still reports as overridden.

matthewv789’s picture

What I've found is the thing that remains overridden is the machine name field - it wasn't filled in in the imported blocks. Pasting in the proper machine name removed the overridden status.

eworwa’s picture

Hi, I tried the solution posted by matthewv789 but didn't work for me. In my imported feature module wasn't present the machine_name entry at all, so I added it with no effect. I try cleaning the cache just before trying to revert the module but didn't work neather.

I also try the solution posted here related to the fe_block module but didn't work neather. I've got the ultimate release of the related modules.

el_reverend’s picture

I ran across the same problem that I could not revert a block (content & settings) because in site 1 this block did not have a machine name but in site 2 (the dev site) it did.

I had to add the machine name to the same block in site 1 and then it let me revert it.

This causes potential issues with:
- updating features that are created by client, but updated by dev.
- creating new block on the dev site to be imported to the prod site.

May I suggest a solution. Make the machine name an auto-generated version (ala features export) of the block description, which in turn is required. That way any block ever created and featurized will always have a matching machine name.

charginghawk’s picture

Had this issue, #14's solution, adding block with said machine name then reverting it, worked for me.

timhtheos’s picture

#14 works for me. Blocks that do not have machine names cannot be features reverted. For them to be reverted, machine names must be set first via hook update or hook install (of that feature if it is a new feature).

function MODULE_update_N() {
  $block_title = 'block-title';
  $theme_name = 'theme-name';
  $block_machine_name = 'block_machine_name';

  _block_rehash($theme_name);

  // Query block delta. 
  $delta = db_select('block', 'd')
    ->fields('d', array('delta'))
    ->condition('title', $block_title, '=')
    ->condition('theme', $theme_name, '=')
    ->execute()
    ->fetchField();

  // Set block machine name.
  if ($delta) {
   db_merge('fe_block_boxes')
     ->key(array(
       'machine_name' => $block_machine_name,
     ))
     ->fields(array(
       'bid' => $delta,
       'machine_name' => $block_machine_name,
     ))
     ->execute();
  }
}
jody lynn’s picture

I was having the fe_block_settings version problem described in #11. It turned out it was caused by a patch I was using #766264-25: Alter hooks causing status to always be overridden