Description
Node collection (previously names as Entity Collection(Super Node)) is a module that will allow you to add parent child relationships on different content types and will help you to create content rich small microsites inside your Drupal 7 installation . Once you define a parent-child relationship and if you create a parent node, the module will add admin links to create or edit child nodes and vice versa. Therefore you can have a collection of node instances bound together as a collection on a parent child relationship and will make it very easy for a content editor to manage the relationship instances. Once you have created the parent node and the child nodes associated with it using the admin links on the bottom of each parent or child content type edit/create screens you will have the following set of features/abilities enabled per relationship instance basis.
- A menu item will be created automatically to link up the parent and the children together for each relationship instance (parent-child node collection).
- The menu generated will be rendered on theme $title_prefix horizontally so that it will provide you with a small browsable microsite on you visit any of the parent or child node instance.
- Relative path for the children will be automatically generated (If the parent path is http://example.com/parent the child path will be http://example.com/parent/child).
- Template suggestions will be added based on the relationship so that you can theme the collection differently regardless of the content type individually (Please see below or read the README file in the module for more documentation).
- The parent node object will be accessible to any child node object in the theme layer. Therefore you can add more logic onto it based on the relationship.
- Set of API functions which will allow a developer to use the relationship data elsewhere in the site.
Project, Repo and Version details
Project page: http://drupal.org/sandbox/sankatha/1493998
Git clone: git clone --branch 7.x-1.x sankatha@git.drupal.org:sandbox/sankatha/1493998.git
Version: Drupal 7
Comments
Comment #1
patrickd commentedwelcome,
Please rename your readme to "README.txt"
Great, you've already cleaned up all styling stuff reported by automated reviews :)
Putting the module in the category/package called "Maya" doesn't make much sense for me ?
You can also get a review bonus and we will come back to your application sooner.
regards
Comment #2
sankatha commentedHi Patrick. Thank you very much for looking into this module. I have renamed the readme.txt to README.txt and also have removed the package information from the info file so it can go into OTHER. I have written this module for one of my clients and Maya was actually a project code name :D and sorry for leaving it over. I am very much looking forward to review some of the modules. Thanks again - San
Comment #3
logaritmisk commentedThe name entity_collection is already taken (http://drupal.org/project/entity_collection)
Comment #4
logaritmisk commentedForgot to change status. I guess you need to find a new name :/
Comment #4.0
logaritmisk commentedChanges a sentence so that it makes more sense.
Comment #5
sankatha commentedHi Guys. Thank you very much for your help and reviews. I have renamed the project to Node Collection (Had a look around and cant find any by that name :) though).
Comment #6
sankatha commentedComment #6.0
sankatha commentedChange the body so that it reflects the new name.
Comment #7
sankatha commentedAdding the "PAReview: review bonus" Tag
Comment #8
itsekhmistro commentedOne issue found: There are still files other than README.txt in the master branch.
Please remove all files except README.txt from master branch.
Rename `readme.txt` into `README.txt`.
Code is verified with Drupal Code Sniffer. All is ok.
Installed and tested on fresh Drupal installation. Works fine.
Comment #9
sankatha commentedThanks for the review Ivan. I have removed everything from the Master branch except the README.txt.
Comment #10
itsekhmistro commentedLooks fine. ( please, also remove empty API/ folder from master branch)
Comment #11
sankatha commentedHi Ivan. Thanks again. Seems like the API folder is not there :( (http://drupalcode.org/sandbox/sankatha/1493998.git/tree/refs/heads/master).
Comment #12
itsekhmistro commentedYes, it's ok.
Comment #12.0
itsekhmistro commentedAdded Reviews of other projects section to the issue summery
Comment #13
patrickd commentedSorry, I got to remove that tag as per
From #1410826: [META] Review bonus
Please do 3 manual reviews for getting a review bonus
Comment #14
sankatha commentedHi Patrick. No worries. I have done manual reviews against the reports anyway but will do some more reviews to help you guys :).
Comment #14.0
sankatha commentedMore to Reviews of other projects.
Comment #15
patrickd commentedWe all really appreciate that :)
Comment #16
patrickd commentedme will do it
Comment #17
sankatha commentedHi Patrick. Sorry I am not clear on your comment 'me will do it' ? :)
Comment #18
patrickd commentedMinor stuff that catched my eye
require_once "$module_path/admin/node_collection_node_forms.admin.inc";doing that drupal_get_dir stuff is not necessary (and looks ugly)require_once 'admin/node_collection_node_forms.admin.inc';should just work the sameImplements hook_perm().update to hook_permissionThe base table for node_collection_parent.This is not very helpful, describing what exactly the table is good for is a more common practicePlease start function descriptions with a short intro (like "Implements .."); leave a blank comment line and end comments with a dot
Security issue:
Your not filtering the relation name correctly, putting
<script>alert('xss');</script>into it will cause the site to execute that js (= XSS).Make sure to filter all your output correctly. There are several functions for that, in this case check_plain() should do the job.
Please inform your self about that. (Also have a look at the presentation about security vulnerabilities at denver)
Also the module did not work out for me really good
Did I overlook something?
regards
Comment #19
patrickd commented.
Comment #20
sankatha commentedHi Patrick. Thanks for the review. Just to answer the follwing
You probably have not created the child items using the links in the vertical tabs in the menu create/edit form add should have used the Content > Add content instead which will not work.
Will fix the other issues shortly :)
Cheers
San
Comment #21
patrickd commentedAhh, okay, I see (that link is hard to find, that's probably another good point for using a MENU_LOCAL_ACTION ;) )
Comment #22
sankatha commentedYup Agree :). Just changing it...
Comment #23
sankatha commentedHi Patrick
The following issues were addressed as requested.
usually permission machine names are separated with whitspace not underscore (administer_node_collections -> administer_node_collections)Resolution: Removed the underscores and added spaces.
require_once "$module_path/admin/node_collection_node_forms.admin.inc";doing that drupal_get_dir stuff is not necessary (and looks ugly)require_once 'admin/node_collection_node_forms.admin.inc';should just work the sameResolution: Cleaned up as suggested :)
Implements hook_perm().update to hook_permissionResolution: Updated to hook_permission.
The base table for node_collection_parent.This is not very helpful, describing what exactly the table is good for is a more common practiceResolution: Added more meaningful table descriptions.
* Implements hook_form().<br> * Admin settings form for the node collectionsPlease start function descriptions with a short intro (like "Implements .."); leave a blank comment line and end comments with a dot* Implements hook_form().<br> *<br> * Admin settings form for the node collections.Resolution: Fixed by adding a new line as suggested.
Maybe admin/structure or admin/config/content is a better place for your module config?Resolution: Used admin/config/content.
What about using a MENU_LOCAL_ACTION for your add relationship link ?Resolution: Added MENU_LOCAL_ACTION and removed the vertical tab form alter :)
Please use the "empty" option of tables to define a message to show instead of an header-only table (looks broken)Resolution: Added the empty option to theme_table.
you should really think about using shorter paths (node_collection_settings/edit_delete_node_collection_relationships could be node-collection/list)Resolution: Added shorter paths as suggested.
Security issue:
Your not filtering the relation name correctly, putting
<script>alert('xss');</script>into it will cause the site to execute that js (= XSS).Resolution: Ahhh ! Sorry I missed this in the first place :). Fixed.
Regards
San
Comment #24
sankatha commentedComment #24.0
sankatha commentedRemoving the automated test result comments from the Reviews of other projects
Comment #24.1
sankatha commentedAdded another review link
Comment #25
sankatha commentedAdding PAReview: review bonus tag.
Comment #26
itsekhmistro commentedManual review,
are you sure all this includes are requried globally?
forexample, I mean why not to put conditional load for admin/node_collection.admin.inc in node_collection_menu()
Comment #27
sankatha commentedThanks for the review. node_collection.api.inc requires globally. I prefer the rest defined together as well because it makes it looks cleaner here and the code will be more readable for me. Just a personal coding style :). And the way you suggest will give you very litte or no benefit at all because these files are very small. So no offence. Just my coding style :) in this occasion. Also in Drupal coding standards it does not say anything about the style to follow http://drupal.org/coding-standards#includes as well. Hope this helps.
Comment #28
sankatha commentedComment #29
seyv commentedHi sankatha,
Pretty solid module, I can't find any immediate changes I would suggest. Except:
NODE_COLLECTION_SETTINGS_PATH. Currently the settings for your module appear inadmin/config/content/by adding a title, description they will group under your module name.That's it, guess this is almost done ;)
Comment #30
sankatha commentedHi Sey. Thanks for the review. As per Patrick's suggestions(http://drupal.org/node/1494434#comment-5813600) I have to change it to admin/config/content/. It was used to be in its own group :).
Comment #31
seyv commentedOk, I missed part 6 of his comment ^^ Then I feel this is done ;)
Comment #32
sankatha commentedCheers ;)
Comment #33
klausimanual review:
Otherwise I think this is nearly ready. Good work so far! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #34
sankatha commentedHi klausi. Thanks for the review. Will fix these asap :)
Comment #35
sankatha commented"dependencies[] = pathauto": really? why would you require that?Resolution: Removed the dependency. You were right. I dont need it.node_collection_schema(): copy and paste error for the child nid "'description' => 'Node collection parent ID.',".Resolution: Fixednode_collection.module: you are requiring a bunch a files globally here, which will be included on every single page request. Ideally you should only expose hook implementations and API functions that might be used by other modules globally.Resolution: Kept the API file and removed all the other requires as necessary.Your module file is quite small. While not an official standard it is recommended to have the important hook implementations directly in your module file, so that I can find them faster if I try to figure out where your module hooks into Drupal.Resolution: Moved all the hook implementations to the module file.node_collection_admin_settings_form(): doc block is wrong, this is not a hook. See http://drupal.org/node/1354#formsResolution: FixedSimilar for node_collection_admin_settings_form_submit().Resolution: Fixed"throw new RuntimeException(...": hm, better define your own exception class to distinguish them from real PHP runtime errors?Resolution: Defined the NodeCollectionRuntimeException class which extends the Exception base class and refactored the code to use that instead."db_insert('node_collection_parent')": better use drupal_write_record() which also validates against the DB schema. Same for you db_update() calls.Resolution: Changed to use db_write_recordnode_collection_api_get_parent_node_instance(): do not use node_load() in a loop, this will be slow. Use node_load_multiple() instead.Resolution: I am loading only one record here. Therefore changes the query so that it uses rage and fetchField"$child_nid->ec_child_nid": the prefix "ec" still stems from the old module name and does not make sense anymore. You should probably replace it with "nc" to avoid confusion.Resolution: Changed.node_collection_api_is_child_instance(): you don't need the foreach() and you should limit the query with range() if you are interested in only one record. And you can use fetchField() or similar.Resolution: Changes as suggested.Comment #36
soncco commentedHello @sankatha, your module rocks :)
My simple review:
Comment #37
sankatha commentedHey @Soncco. Thanks and thanks for pointing me out the README.txt in the master branch. Just done it ;)
Comment #38
soncco commentedYou're welcome @sankatha. I'm changing the status.
Comment #39
sankatha commentedI am giving this module a good test. Hence changing the status to needs work.
Comment #40
sankatha commentedFixed and tested as suggested by @klausi.
Comment #41
klausiSorry for the delay, but doing reviews with #1410826: [META] Review bonus is currently the only way to make this process faster.
Review of the 7.x-1.x branch:
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. Get a review bonus and we will come back to your application sooner.
manual review:
require_once dirname(__FILE__) . '/mymodule.inc';to avoid possible issues with relative paths. Also elsewhere.Although you should definitively fix those issues they are not application blockers to me, so I guess this is RTBC
Comment #42
sankatha commentedThanks @klausi. This will be what I am working on this weekend :)
Comment #43
patrickd commentedThanks for your contribution and welcome to the community of project contributors on drupal.org!
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #44
sankatha commentedThank you very much for all your help and support through out the process. Will fix the issues @klausi raised and make this module available as a release.Also will look forward to contribute more towards Drupal.
Comment #45.0
(not verified) commentedAnother review added.