Overview
This module allows admins to create rules. Each of these rules will prevent a user from adding one particular content type unless the user has finished adding a specified number of another content type. The number can be specified by the admin.
Example
- You want a user to add a company page for the user to be able to start adding a products page
- Your user needs to add his profile before he can start posting blogs
Details
Project page: https://drupal.org/sandbox/neerajskydiver/2134689
Checkout: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/neerajskydiver/2134689.git content_type_dependency
Manual reviews of other projects
https://drupal.org/comment/8178663#comment-8178663
https://drupal.org/node/2135793#comment-8179545
https://drupal.org/comment/8187293#comment-8187293
https://drupal.org/comment/8198077#comment-8198077
https://drupal.org/comment/8198199#comment-8198199
https://drupal.org/node/2138865#comment-8199157
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | Content_Type_Dependency.jpg | 53.23 KB | neerajskydiver |
Comments
Comment #1
neerajskydiver commentedAdded code review link
Comment #2
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 #3
neerajskydiver commentedComment #4
nitesh pawar commentedHi eerajskydiver,
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Comment #5
idebr commentedHi Neeraj,
Great idea and a great module! Just a few things before you release:
Comment #6
neerajskydiver commentedThanks Niteshp & idebr
#4
Master branch has deleted
#5
1. configure line added in .info file
2. .admin.inc file created & loaded to hook_menu
3. Deleted hook_uninstall_schema.
4. Dependency node is added to .info file
5. Confirm form was created for delete option
Comment #7
neerajskydiver commentedComment #8
asghar commentedI have installed and Configured it and check it different users. Also review your module code and it is working fine.
Comment #9
neerajskydiver commentedAdded code review link
Comment #10
neerajskydiver commentedComment #11
neerajskydiver commentedComment #12
kscheirerYou can make content_type_dependency_form_node_form_alter() a lot simpler.
Setting to "needs work" for the number of issues. You might want to consider actually integrating this module with the Rules API, I think it would get you a lot more flexibility and a simpler module.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #13
neerajskydiver commentedHi Karl,
Thank you for detailed comments.
Have updated README.txt as explained in guidelines for in-project documentation.
Removed back ticks (`) and instead used {}
Made the changes and now loading enabled rules only.
Updated doc blocks in content_type_dependency.admin.inc.
Rechecked t() in all form title and description
My mistake, removed inline css
I have not thought about Rules API, will look into.
Comment #14
neerajskydiver commentedComment #15
neerajskydiver commentedAdded code review link
Comment #16
balagan commentedI do not think dependencies[]= node makes any sense, although I saw the comment recommending it.
I have uploaded a patch, where I have corrected lots of typos.
I see you have created a whole new edit form. I would use only one form, where I set the default values from the URL. If you change any strings (or fix typos), now you have to do it twice on two forms.
Regarding the confirm_form, I could not find it.
Comment #17
neerajskydiver commentedbalaban, Thank you for your valuable input regarding typos used in the module. Would review and incorporate your suggestions.
Comment #18
neerajskydiver commentedComment #19
neerajskydiver commentedChanged typo as suggested by balagan.
Also now only one form for both editing & new rule.
Comment #20
neerajskydiver commentedComment #21
akshat.khariwal commentedComment #22
akshat.khariwal commentedCloned the project from git (http://git.drupal.org/sandbox/neerajskydiver/2134689.git), but was not able to find the changes suggested in comment #12 and #16.
Additionally, I'd like to suggest you to use EntityFieldQuery in 'content_type_dependency_node_count()' instead of 'db_query()'.
Comment #23
neerajskydiver commentedHi akshat.khariwal, Thank you for your valuable input.
Have made changes as suggested
to
Comment #24
neerajskydiver commentedakshat.khariwal, also try downloading from git again. Have tested for both comments you have mentioned.
Comment #25
neerajskydiver commentedComment #26
klausimanual review:
<script>alert('XSS');</script>for a dependency I get a nasty javascript popup. You need to sanitize all user provided text before printing. Make sure to read https://drupal.org/node/28984 again. Same for content_type_dependency_form_node_form_alter(), you need to sanitize $record->message first. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.Comment #27
neerajskydiver commentedHi klausi, Thank you for your review.
1. Done. Have updated descriptions of DB column.
2. Done. Have updated all user facing text with t() function.
3. Done.
4. Done. Have used confirmation form for deleting and security tokens for enable/disable rule.
Comment #28
neerajskydiver commentedComment #29
klausimanual review:
'<a href="' . $url . '">Disable</a>', '<a href="' . $url_edit . '">Edit</a> / <a href="' . $url_delete . '" ">Delete</a>');: Disable and Delete should also run through t() for translation, please check all your strings.That are not critical application blockers, so I think this is RTBC otherwise.
Assigning to cweagans as he might have time to take a final look at this.
Comment #30
neerajskydiver commentedThanks klausi for your feedback and updating project review status.
Comment #31
ram4nd commentedComment #32
neerajskydiver commentedHi ram4nd, thanks for reviewing.
Definately i would consider using abstraction later in next version. Will check for consistency regarding single quote.
Comment #33
neerajskydiver commentedComment #34
klausino other objections for more than a week, so ...
Thanks for your contribution, neerajskydiver!
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 #35
neerajskydiver commentedHi klausi,
Thank you for the approval.
Thanks also to ram4nd, Niteshp, idebr, asghar, kscheirer, balagan, akshat.khariwal for your help with the review and helping in improving project!.
Best
Neeraj