CONTENTS OF THIS FILE
---------------------
* Introduction
* Features
* Examples
* Requirements
* Installation
* Contacts
INTRODUCTION
------------
Allow prioritization of the Drupal's hooks. Set weight for each hook in Drupal
is not so trivial as in other CMSs so, this plugin attempt to fix this.
FEATURES
--------
* Set weight for hook
* Set weigth for hook auto and attached before/after other module
* Set hook be to beginning or ending in the stack
EXAMPLES
--------
Hooks are performed by a weight in ascending order.
Set function can be called without be in hook.
/**
* Implements hook_init().
*/
function mymodule_init() {
// do something.
}
// Set hook be performed in order where default weight is 0
hook_priority_set('mymodule_init', 100);
/**
* Implements hook_domain_delete().
*/
function mymodule_domain_delete() {
// do something.
}
// Set hook to be performed after the hook from module 'domain_conf'
hook_priority_set_after('mymodule_domain_delete', 'domain_conf');
Overview:
// Set pririty/weight for a hook to specific number.
hook_priority_set(string <hookname>, int <weight>);
// Move hook to be performed as first.
hook_priority_set_first(string <hookname>);
// Move hook to be performed as last.
hook_priority_set_last(string <hookname>);
// Move hook to be performed before hook from other module.
hook_priority_set_before(string <hookname>, string <module>);
// Move hook to be performed after hook from other module.
hook_priority_set_after(string <hookname>, string <module>);
REQUIREMENTS
------------
* Drupal 7.x
DOWNLOAD
-----------
Project page: http://drupal.org/node/1586688
Git (drupal.org): http://git.drupal.org/sandbox/dimitrov.adrian/1586688.git
Git (github): https://github.com/dimitrov-adrian/hook_priority
INSTALLATION
------------
1) Unarchive the zip and put directory into your sites/all/modules
2) Enable it from your admin panel -> Modules
CONTACTS
--------
Developer: Adrian Dimtrov
Company: ProPeople (www.wearepropeople.com)
Comments
Comment #1
patrickd commentedwelcome,
Good to see your project page and readme are very detailed, but please use html-tags on your project page because it look a little unstructured at the moment and is hard to read.
Beside this, your module looks pretty good so far.
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
regards
Comment #2
dimitrov.adrian commentedThanks,
I was updating the module and project page according your hints. Hope I am step closer to approvement. May be some of my comments are not so clear because my English, so I am accepting critics and suggestions ;)
Overall, thanks for your post.
regards
Comment #3
manish.kumar commentedGood work. Nice to see the comments.
Comment #4
dimitrov.adrian commentedThanks,
I am thinking a way to make it more independent, which will allow disabling the module without hurt other modules that using it, so any suggestions are welcome (not only for this feature).
But I think the current versions is completely working and functional, so please if someone had permissions to make project full, I will be glad for that.
Comment #5
rballou commentedHello,
Automatic Review:
Using the pareview app found this:
Manual Review:
Comment #6
dimitrov.adrian commentedAt least as I research there is no such module before I starting this one. Of course now may be there are because I using it 2-3 months before commit and the project stay on the queue 2 more months.
However, I am fixing this pareview warning, thanks.
About the info file, what is your suggestion, it will be great if you can help with this, because my native language is not English, I am very triftly of words ;)
regards!
Comment #7
martins.bertins commentedThe PAReview returned no errors.
Just a couple small things:
1. In hook_priority.module file you have mistyped implemented hook name (line 112);
2. In info file description you could use the first sentence of introduction from readme file.
Other than that found no functional problems with your module.
Good luck!
Comment #8
dimitrov.adrian commentedFixed, thanks for the feedback!
Comment #9
joelrosen commentedHi there,
I was just looking for project applications to review and I came across this one. I see it's been sitting here for two months with no activity, and, reading through the code and documentation, I'm thinking the reason that nobody has stepped up to touch this is because of one basic problem with the module that is not easy to address constructively:
If I understand correctly, the premise of this module is essentially that hook_module_implements_alter is too difficult for developers to use, and provides a few convenience functions to wrap around it. The problem is that, from the perspective of the average Drupal developer, this module doesn't appear to be easier to use than hook_module_implements_alter and also seems like it might be a risky module to install.
Here's my reasoning:
Why this module isn't obviously easier than hook_module_implements_alter
Why this module seems risky to install
If I just want to change the relative order of one hook, do I really want this module to change the weight of all hooks in my Drupal installation?
Since drupal_static only stores data for the duration of a single page request, this means that in order to get any data here, hook_priority_set needs to be run during the same request as hook_priority_module_implements_alter, which is run when? When caches are cleared? Again, maybe this is just a documentation issue, and you just need to explain where your functions should go so that hook_priority_module_implements_alter sees them.
So, again, I'm not an authority here, but I'm guessing that in order to get full project status, this module needs to do more to convince developers that it is a good alternative to just using Drupal's native hooks. Maybe you just need to explain more clearly in your project page and documentation what the use case for this module is and what specific problem it solves.
Comment #10
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #11
klausiProject 1: http://drupal.org/node/1587176
Project 2: http://drupal.org/node/1772350
Project 3: http://drupal.org/node/1453964
Project 4: http://drupal.org/node/1406352
Project 5: http://drupal.org/node/1438600
Project 6: http://drupal.org/node/1929114
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
Comment #11.0
klausiStyling
Comment #12
avpaderno