Workbench Moderation Profile is an extension of Workbench Moderation. It adds the ability to have multiple workflows, divided into profiles, based on the states and transitions defined by Workbench Moderation. These workflow profiles can then be applied to nodes based on criteria you determine, and an API is included to help with that process.
It comes with two submodules, Workbench Moderation Profile Node and Workbench Moderation Profile OG, which allow you to define profiles of transitions by content type and Organic Group, respectively.
Link to project page: https://drupal.org/sandbox/srjosh/2172925
Link to repository: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/srjosh/2172925.git
It is probably worth noting that I am a committer on the http://drupal.org/projects/workbench_moderation module.
Comments
Comment #1
srjoshComment #2
shantanu1 commentedHi srjosh,
Here are some quick issues to get started:
Also, please take a look at the automated code review results here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxsrjosh2172925git
Thanks
Shantanu
Comment #3
shantanu1 commentedComment #4
srjoshAll noted issues have been addressed.
http://pareview.sh/pareview/httpgitdrupalorgsandboxsrjosh2172925git
Comment #5
dsnopekOverall, the module looks great! I just have some nit picky stuff:
files[] = workbench_moderation_profile.entity.incto the .info file. After clearing your cache, this will add your classes/interfaces to the code registry so the files will only be loaded (by the PHP autoloader) when they are used. Of course, those classes are really short so this doesn't provide much value in this case, but it is a best practice! You can learn more about the code registry here: https://drupal.org/node/350780files[]currently is unnecessary! You only need to specify files which contain classes or interfaces for the code registry to do autoloading. See the link I gave in the previous point for the full info. And .module files never need to be specified because they are always loaded.WorkbenchModerationProfileUIControllerclass is defined in workbench_moderation_profile.admin.inc, which is mostly fine (espectially since it's listed infiles[]in the .info file!) - but if you move the other classes to a workbench_moderation_profile.entity.inc file per the previous point, you should put that one there too for consistency.... where as it should be:
You can pretty much copy and modify the examples from the docs that I linked above. As an aside about that particular function: it's convention (although totally not required) to name form constructors as *_form().
/*instead of/**(two stars). In order to get properly parsed by the API module, those comments need to have two stars. Some examples of functions with only one star include:workbench_moderation_profile_workbench_moderation_states_next_alter(),_workbench_moderation_profile_weighted_modules(),workbench_moderation_profile_form_workbench_moderation_admin_transitions_form_alter, and several more.That's all I have for now! However, I don't think there is much after that stuff...
Comment #6
srjoshThanks dsnopek!
Numbers 3 and 6 should have been addressed already with the latest round of changes. I'll look into the other ones ASAP.
Comment #7
srjoshdsnopek - all concerns are resolved.
#1 - see https://drupal.org/node/2174343 for feature request.
Thanks for the feedback!
Comment #8
dsnopekThe patch at #2174343: Make transitions into entities, for use with entity reference fields looks awesome!
All my nitpicks are addressed. I probably should have mentioned originally that I also tested the module and it works as described.
I can't find anything else that this application needs to get approved - marking as RTBC.
Excellent work! :-)
Comment #9
srjoshAs a side note, I've pushed up the branch of workbench_moderation_profile that has the entity code removed, in case #2174343: Make transitions into entities, for use with entity reference fields is accepted, or in case someone wants to use that patch.
git clone --branch 7.x-1.x-no-transition-entity http://git.drupal.org/sandbox/srjosh/2172925.git
Comment #10
dsnopekI just noticed something that I didn't catch on my first couple passes through.
On line 380 in workbench_moderation_profile.module, there is:
What you probably actually mean is:
drupal_static() always returns the same reference for the same argument (in this case __FUNCTION__ or "workbench_moderation_profile_get_states"). So, with the current code it's making every entry in $wmp_states a reference to the same value, which would probably lead to errors if you called workbench_moderation_profile_get_states() twice with two different profiles in the same request.
Also, minor coding style issues have snuck in since you last fixed them from PAReview.sh:
http://pareview.sh/pareview/httpgitdrupalorgsandboxsrjosh2172925git
Comment #11
srjoshAll issues have been addressed as of commit #88f0221. Thanks dsnopek!
Comment #12
dsnopekLooks good, thanks!
Comment #13
srjoshComment #14
mpotter commentedMinor issue: in the admin/structure menu it shows as "Workbench Moderation Profile settings" and should just be called "Workbench Moderation Profiles"
Comment #15
srjoshFixed in commit a9fda10.
Thanks @mpotter!
Comment #16
pingwin4egHello @srjosh
There are still some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxsrjosh2172925git-7x-1x
Though below is the only release blocker, you should also take care of other coding style issues.
Please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Comment #17
srjoshComment #18
srjoshAll changes have been noted and dealt with.
Comment #19
ultimateboy commentedAll issues that have been brought up have been promptly resolved by srjosh.
Comment #20
hefox commentedI'm a comaintainer, so made it a full project as a comaintainer, not sure what else should be done here -- e.g. giving srjosh ability to create more full projects?
Comment #21
stborchertThanks for your contribution, Joshua!
I updated your account so you can 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 #22
jackshot commentedHi Srjosh
When I edit profile encounter system warning as below, I can't save continue, could you help check? thanks in advance.
Notice: Undefined property: stdClass::$id in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Notice: Undefined property: stdClass::$name in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Notice: Undefined property: stdClass::$id in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Notice: Undefined property: stdClass::$name in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Notice: Undefined property: stdClass::$id in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Notice: Undefined property: stdClass::$name in workbench_moderation_profile_form_alter() (line 573 of C:\Bitnami\openatrium-2.23-0\apps\openatrium\htdocs\sites\all\modules\workbench_moderation_profile\workbench_moderation_profile.module).
Transitions field is required.
Comment #23
srjoshJackshot - as I noted in email, please use the issue queue for the module to report issues. https://www.drupal.org/project/issues/workbench_moderation_profile