Needs work
Project:
Features
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2012 at 07:45 UTC
Updated:
16 Jan 2012 at 06:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
hefox commentedWorking on tests that detect more, including using alter hooks. This is a patch just to show someone.
Note includes patch in #1401686: Caching in features_get_default doesn't handle $alter argument
The tests are failing due to #766264: Alter hooks causing status to always be overridden
Comment #2
hefox commentedUpdating patching.
new component hook hook_features_overridden($module) that if implemented, components can say whether they're features are overriden. This is needed for image -- features_get_default for image cannot determine the image styles correctly cause it doesn't have a proper alter hook, and it builds up the image style on load (adding stuff like module name) (like menu system does). This hook should also make features get component states faster, as the logic of checking the overridden faster is faster then rendering the default hook and checking that.
All tests are passing with that ^ hook in.
Comment #3
hefox commentedComment #4
Grayside commentedOverall the need for a component to report in on whether it's in a shitty state seems shitty, but it makes sense to have that kind of flexibility to support alternate plugin engines. (ctools plugins vs image ad hoc). I imagine every Features integration will need it's own mechanism to explain it?
Will need to review again with the patch applied later, but this seems like a good direction.
Other possibility, drive a core patch since this is a vaguely significant change and only needed by Image. Could attempt to treat all instances like this as bugs.
Now, a few dreditor-powered nitpicks.
Should be just 'a', no?
Huh?
Whitespace
Confusing description. Probably should read "allowed states" and have a second text section explaining what its for.
Comment #5
hefox commentedTo clarify, this is a suggestion of a patch then a real one -- it combines #1401686: Caching in features_get_default doesn't handle $alter argument and fix for #766264: Alter hooks causing status to always be overridden and this (the tests). I'll fix it up and separate it later (thus why needs work status instead of of needs review); my question/needs review part is whether testing like this is correct/desirable; I'm rather new to writing tests.
The global is being used cause need to turn on and off the alter hooks in features_test to test that the alters work without causing issues.