If you select a rule category component for a feature, you will see 'Array' show up under the list of Rules components. I've attached a screenshot so you can see what I'm talking about. It appears to function properly otherwise.

Comments

fago’s picture

Version: 6.x-1.0-beta3 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.03 KB

I noted the same problem, attached is a fix.

The new form doesn't use the key as component name. As we discussed at #551490: Allow renaming of components features should use the array key for consistency - attached patch fixes that.

fago’s picture

StatusFileSize
new1.7 KB

Fixed patch to work right when show the dependencies.

jmiccolis’s picture

Status: Needs review » Fixed

Thanks fago, I've committed the patch in #2 http://drupal.org/cvs?commit=290838

Status: Fixed » Closed (fixed)

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

jmiccolis’s picture

Status: Closed (fixed) » Active

Fago, this patch created more problems than it fixed and I'm thinking about reverting part of it. Currently anything provided by other modules shows up as a "0" on rebuild.

What's concerning to me is that this happens because the data used here is read from the info file - and the info files we write don't have meaningful keys at this stage - they're just numerically indexed lists. But internally to the features module we're letting this get swapped and this concerns me. I'm starting to think about whether we want the internal representation of the info file to drift and if it's truly necessary to do so.

yhahn’s picture

I've reverted #2 for the time being.

fago’s picture

Status: Active » Closed (won't fix)

ouch. As it's still reverted I see no clean way to support rules with features, so I'm going to drop support for that (till now it was experimental anyway). Also exporting rule_set had troubles with the detecting overrides still rule_category feature components and rule_sets shared the same default hook. Thus I'm also dropping that and leave it with supporting feature exports by category only - at least that seams to work fine for me.

Users that previously have exported features containing single rule or rule_sets components need to fix the existing features. For that just edit the feature's .info file remove any non-categories rule components and add the category component:

features[rules_categories][] = "YOUR_FEATURE_NAME"

That's working fine as any previously rules feature export got the feature name as category assigned.

q0rban’s picture

Are you saying you *have* to use your feature name as the category for rules? This seems strange.

I'm…[leaving]…it with supporting feature exports by category only - at least that seams to work fine for me.

You say that you are dropping support for rules and rule_sets, since only rule categories are working for you, but this bug *is about* rule categories.

fago’s picture

You don't have to use the feature name as you category, but if you don't do it will add such a category for you. Imo that makes sense. Since there is those category already for any previously export rule components, you can use it for adding those rules back into the feature again.

@bug: "Array" was shown for the rules if you look at the screenshot. The underlying problem is only relevant for rule and rule_set components and not solved, that's why they aren't supported any more. Categories are and work fine for me now.
Anyone experiencing troubles please open issues in the rules issue queue for the features component.