Closed (fixed)
Project:
Features
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2012 at 11:28 UTC
Updated:
17 Jun 2014 at 21:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Cauliflower commentedSee patch attached to this comment.
Comment #2
Pete B commentedI like this, but I also want to react on other features changing state. This is so we can easily implement some site-wide hooks before and after ANY feature is reverted.
I'll upload an altered patch.
Comment #3
Pete B commentedComment #4
hefox commentedchanging how a hook function (adding the null version of pre hook) is likely breaking api. probably better for a new hook.
Assume that was a typo in title
Comment #5
das-peter commentedComing from here #2241979: Add a way to prevent exportable rebuild on cron run I've built another approach.
I'm not sure if it's necessary to introduce a hook for every operation.
Attached patch uses another approach by introduce a "restore" specific hook that passes on the chosen operation and the items.
As a sidenote to #1844566-3: Invoke pre and post hooks when ALL components have been enabled what's the great benefit of having
module_invoke($module_name, $pre_hook, null);?I think
module_invoke_all($restore_hook . '_before', $items);would be sufficient to achieve whatever's possible with the other hook too. Of course one would have to iterate over the items / components list on it's own but the performance drawback is not that huge and it's not that those operations are end user runtime tasks that need to be lightening fast.Comment #6
fagoI'd agree with #5 that a single hook is sufficient.
I've reviewed #5 and it looks good to me. I think it's generally a reasonable addition, but moreover the introduction of this hook would allow entity API to integrate with features for rebuilding its default exportables in the database, see #2241979: Add a way to prevent exportable rebuild on cron run. So +1 on adding this.
Comment #7
Pete B commentedI'm happy with #5, which would solve my use-case. I'd love to see this released now that it has had a few eyes on it.
Comment #8
hefox commentedThanks