Synopsis
This module adds an event dispatcher to the preprocess hook. This way your modules can subscribe to preprocess events to add extra functionality. This will advocate a more event driven development instead of the old hook function based development.
Requirements
None, except of course Drupal 8.x
Recommended modules
None.
Roadmap
Add more events to the dispatcher beside the preprocess events.
Credits
ibuildings For sponsoring initial development.
Similar projects and how they are different
None that I know off. Try to find it at the start, but I have found no similar projects.
Dependencies
Drupal 8.x
Restrictions
None.
Project page
https://www.drupal.org/sandbox/pdenooijer/2841877
Clone command
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/pdenooijer/2841877.git preprocess_event
cd preprocess_event Reviews
- https://www.drupal.org/node/2847434#comment-11902036
- https://www.drupal.org/node/2740823#comment-11902086
- https://www.drupal.org/node/2847546#comment-11902165
Extra reviews
- https://www.drupal.org/node/2847434#comment-11904406
- https://www.drupal.org/node/2847546#comment-11904452
- https://www.drupal.org/node/2847279#comment-11904506
pareview.sh
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | coder-results.txt | 12.18 KB | klausi |
Comments
Comment #2
pdenooijer commentedComment #3
visabhishek commentedComment #4
PA robot commentedProject 1: https://www.drupal.org/node/2847414
Project 2: https://www.drupal.org/node/2628268
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.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #5
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
pdenooijer commentedComment #7
pdenooijer commentedComment #8
pdenooijer commentedComment #9
pdenooijer commentedComment #10
pdenooijer commentedComment #11
pdenooijer commentedComment #12
pdenooijer commentedComment #13
pdenooijer commentedComment #14
mxh commentedSimilar projects and how they are different
You might want to take a look at https://www.drupal.org/project/hook_event_dispatcher.
This module aims to solve the problem more horizontal, i.e. it aims to add event dispatchers to any hook where you might want to work with object-oriented events rather than functional hooks. You could work with the maintainers of this module to add preprocess hooks, if not yet available.
In the end, I wouldn't consider installing multiple modules with different approaches and (maybe event redundant) implementations for a single, development-only purpose. Having one module which solves the problem (at least almost) completely would be more considerable in general. Therefore I'd recommend to work with the maintainers of hook_event_dispatcher and try to bring this module further.
Comment #15
pdenooijer commentedHook Event Dispatcher is not really extendible like my implementation. I have no problem putting some more work in to adding more events the same extendible way to other hook calls.
I see someone opened an issue, let's see if there is any reaction from the developer. It seems to me since October there has been no activity. I'll make an issue to see if the developer wants to extends his module with my preprocess implementation.
Comment #16
pdenooijer commentedComment #17
zyyz commentedpreprocess_event.services.yml : Deprecated use of @ on unquoted string. According to Yaml specification, unquoted strings cannot start with @.
PreprocessEventInterface.php : Undefined class AbstractEventVariables => use the full class name instead \Drupal\preprocess_event\Variables\AbstractEventVariables.
PreprocessEventFactoryInterface.php : return type undefined, AbstractPreprocessEvent. Use the full class instead Drupal\preprocess_event\Event\AbstractPreprocessEvent.
EckEntityEventVariables.php : return type undefined, EckEntity. Use the full class path for the paramaters
NodeEventVariables.php : return type ndefined class Node, use the right class even better the interface instead, \Drupal\node\NodeInterface.
ViewEventVariables.php : return type undefined, ViewExecutable. Use the right full class name instead.
ViewFieldEventVariables.php : The same thing for all return types. Use the right full class name.
Comment #18
zyyz commentedComment #19
pdenooijer commentedThanks for the review zyosarian!
I fixed the unquoted strings in the YAML file and updated the php files you mentioned with the right return tags. Those @return tags where broken because originally I had use statements for those, but apparently the pareview does not agree with that practise, so I removed the use statements.
Comment #20
pdenooijer commentedComment #22
klausiReview of the 8.x-1.x branch (commit d7b547f):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Otherwise looks good to me.
Thanks for your contribution, Piet!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #23
mxh commentedCongratulations!
Comment #24
pdenooijer commentedSuper thanks to all, I'm very happy about it :)!