I was having a lot of trouble with drush fd sometimes acting as if it's diffing against something nonexistent. After a lot of debugging I determined that $module->info['features']['field'] was becoming $module->info['features'][0] somewhere. I finally traced it to features_get_info() handing out the original object (so it is acting like a reference)

This patch fixes the problem I was having, but I don't know if it's proper or covers all cases.

CommentFileSizeAuthor
features_fix_diff_user_fields.patch731 bytesbdragon

Comments

bdragon’s picture

Project: Feature » Features
Version: master » 7.x-1.x-dev

Whoops, I had this in the wrong queue.

irakli’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

donquixote’s picture

Issue summary: View changes

This is long time ago, but...

I don't know if it's proper or covers all cases.

It does not.
In the case where $name is provided, a cloned object will be returned.
However, if $name is NULL, the array of original objects will be returned, allowing other code to manipulate the objects.

In fact, the function is itself guilty of modifying the original objects from Drupal core's system_rebuild_module_data() (only happens on reset/rebuild), adding the ->components key.