Reviews of other projects
http://drupal.org/node/1852392#comment-7367956
http://drupal.org/node/1944884#comment-7368094
http://drupal.org/node/1743318#comment-7368110
http://drupal.org/node/1962318#comment-7377656
http://drupal.org/node/1751752#comment-7377696
http://drupal.org/node/1510564#comment-7377748
http://drupal.org/node/1984552#comment-7383786
http://drupal.org/node/1968868#comment-7383838
http://drupal.org/node/1966726#comment-7383882
Please review my sandbox module (7.x).
It is ready to use and I provide full details inc. screenshots at http://drupal.org/sandbox/erez111/1868890
"git clone http://git.drupal.org/sandbox/erez111/1868890.git content_dependency"
Reviewer, please send me any questions if any.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Untitled.png | 54.83 KB | pranit84 |
| #8 | Untitled2.png | 76.77 KB | pranit84 |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxerez1111868890git
We 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 #2
pranit84Check this: http://ventral.org/pareview/httpgitdrupalorgsandboxerez1111868890git
And solve the reported errors/warnings.
Comment #3
pranit84It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
See http://drupal.org/project/1976520/git-instructions
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 #4
erez111 commentedPlease review my module
Comment #5
erez111 commentedComment #6
pranit84First of all solve the suggested changes in #2 and #3.
Comment #7
erez111 commentedChanges #2 + #3 done. Please review.
Comment #8
pranit84I can still see the issues reported in #2 and #3, see the attached screenshot.
Comment #9
erez111 commentedThanks for fast review. Please recheck.
Comment #10
erez111 commentedPlease review my project.
Comment #10.0
erez111 commentedMinor changes
Comment #11
kimberlydb commentedYou still have some warnings: http://ventral.org/pareview/httpgitdrupalorgsandboxerez1111868890git
Review of the 7.x-1.x branch:
./README.txt: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/content_dependency.api.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
14 | WARNING | Hook implementations should not duplicate @param documentation
26 | WARNING | Hook implementations should not duplicate @param documentation
--------------------------------------------------------------------------------
FILE: ...var/www/drupal-7-pareview/pareview_temp/includes/content_dependency.inc
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
161 | WARNING | Only string literals should be passed to t() where possible
164 | WARNING | Only string literals should be passed to t() where possible
Comment #12
erez111 commentedMinor coding standard warning only is not an application blocker, please do a manual review.
README.txt file is ok.
Comment #13
kimberlydb commentedI installed the module and went to a piece of content that already existed, went to the content dependencies tab and the page was totally blank. I could still see the tabs/top menu but the content of the tab is all white. I created a new content type and new content to see if it would work but I get the same thing.
Comment #14
erez111 commentedHi Kimberly,
Thanks for your review.
I just uploaded a new version which display some message (instead of all-white content) when there are no dependencies.
Generally, if you refer (via entity reference or node reference) from some content (node, user, taxonomy, etc.) into current content, you would see the dependencies via "Content Dependency" tab.
Please check the updated version which I just uploaded and tell me your thoughts..
Comment #15
kimberlydb commentedI re-installed the module, and I appreciate the message instead, but it is not entirely clear to me how I actually set up a content dependency.
"That's it! Now, you can see what module does, just enter to your domain
path"/node/NUMBER/edit" and you see "Content Dependency" tab
(just verify you have some entity reference and/or node reference
that refer to this entity (node)."
In the README.txt is a tad confusing as I thought it implied the Content Dependency tab was where you configured the dependencies. I think you should make it a step to add a entity reference field (just to be clear).
--
In content_dependency.inc you have a lot of double, and triple nested foreach loops. I am wondering if there is away to simplify these, possibly through recursion or through changing data structures? Not a deal breaker, but when I see a bunch of nested loops I try and think about how I could optimize it.
--
content_dependency.class line 294 is this supposed to be $key2? On that note, perhaps you could sue a little more clear key/value names. What does value2 represent?
Comment #16
erez111 commentedKimberly,
I appreciate your feedbacks.
You viewed installation steps (which are quite simple), anyway, you should see documented example to discover what you want at "Content dependency images example", which explains how to see what "Content Dependency" does and see actual results.
In addition, I mentioned one of the advantages "You can install this module & start use it without need to perform any change in your content structure".
So, as wrote, no change need to be done especially for this module. However, if there are/will be dependencies, you will be able to see them.
About code issues -
I've used the best complexity I could for total loop iterations which is O(n) although it has 3 canonical foreach loops:
When there are 3 levels of foreach loop, external loop iterations is less than 10 (max number of entity types: nodes, user, taxonomy term, etc.)*middle iterations(categories number)*internal iterations = #of dependent entities.
Complexity of 3 foreach canonical loops is always the same complexity as using a singular foreach loop that is not categorized, but runs widely for all #of dependent entities.
content_dependency.class line 294:
Thank you, I had a bug: "$entity_array_temp as $value" fixed to => "$entity_array_temp as $key => $value"
What does value2 represent? - It represents all entities objects of specific entity types (e.g: a list of node objects).
I just uploaded a version with a bug fix you founded :)
Please tell me if there are more issues/questions, if not, I will appreciate if you can change this project status ;)
Comment #17
samvel commentedHi erez111,
Why you include files in hook_init()? Use place below constants.
$value = "'" . $value . "'";Use $value = (string) $value;
What is it?:) Why you compare constant with FALSE?
Both static, result always the same.
May be use module_invoke_all?
Comment #18
erez111 commentedHello,
Thanks for your review.
I modified comments as mentioned below:
1. I cancelled hook_init() and moved it's content to relevant page callback.
2. I did comments changes as you mentioned. thanks.
Few remarks:
1. $value = "'" . $value . "'" =/> $value = (string) $value;
2. "CONTENT_DEPENDENCY_DISPLAY_NO_ENTITY_BLOCK === FALSE"
What is it?:) Why you compare constant with FALSE? - this is exactly the reason why to use "define". Of course I can switch it to TRUE/FALSE values all over the code.
3. may be use module_invoke_all - Can't pass vars by reference with module_invoke_all().
I will be happy if you can promote this project status.
Comment #19
klausiIssue priority is normal, see http://drupal.org/node/539608
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. You have to get a review bonus to get a review from me.
manual review:
<script>alert('XSS');</script>which has a reference to another node, then I will get a nasty javascript popup. You need to sanitize user provided text before printing, please read http://drupal.org/node/28984 again. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #20
samvel commentedSeems it's my mistake, sorry:
in 17#
Comment #21
erez111 commentedAsik, I used inline comments. (some of comments, used above line, to not exceed 80 characters per line.
Comment #22
erez111 commentedklausi,
Thank you for your review.
I uploaded a new version with following changes:
#1 - Done.
#2 - Done.
#3 - Done - I changed permission key string into lower case string.
#4 - Done.
#5 - Done.
#6 - Done.
#7 - Done. (Fixed for all output).
#8 - Done. I added a theme inc. tpl file "content_dependency_tab_wrapper.tpl.php".
#9 - Done. (dependency added).
README.txt fixed.
Waiting for a review.
Comment #22.0
erez111 commentedHeader fixes
Comment #23
erez111 commentedPlease review my project or promote its status.
Comment #24
samvel commentederez111,
1) why you set status review bonus each time? For this you must check another 3 projects!
2) why you set major status? please see http://drupal.org/node/539608
Comment #25
erez111 commentedAsik,
I already did 3 more new projects review and I replaced old links with new links. Please don't remove review tag next time without verifying details first.
About status, ok. thanks.
Comment #26
klausiplease don't remove the security tag, we keep that for statistics and to show examples of security problems. Please add all your reviews to the issue summary so that we can track them.
manual review:
t('You can') . ' <a href="/node/' . $entity_id . '/edit">' . t('click here') . '</a> ' . t('to edit current') . ' ' . t($entity_type)": Do not concatenate parts of a sentence like that, use placeholders with t() instead. And the link markup will fail if Drupal is installed in a subdirectory, always use url() or l() to create links.Although you should definitively fix those issue I don't think they are critical application blockers, so I would say RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to chx as he might have time to take a final look at this.
Comment #27
erez111 commentedkalusi,
Thanks for your comments.
I uploaded a new version.
Everything done as following:
1. I will do it in next commits.
2. I'm not sure of performance issues of other solution, that why I build it myself.
3. Done. - thanks.
4. Done.
5. I rather that function filter sql injection issues, although it's not send to sql query for this version.
6. Done.
7. Done.
8. Done.
Waiting for chx review.
Comment #27.0
erez111 commentedNew review bonus links
Comment #28
erez111 commentedAdded review bonus. Waiting for a review.
Comment #29
klausino objections for more than a week, so ...
Thanks for your contribution, erez111!
I updated your account to let you 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 get 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 #30
erez111 commentedThank you very much klausi and all other reviewers who help to improve my module.
I uploaded a stable version at http://drupal.org/project/content_dependency
You're all welcome to use it.
Comment #31
klausiJust leave it at fixed, it will close automatically after 2 weeks.
Comment #32
chx commentedSorry for not getting here earlier. I think a quick (==not really through) review is still useful. I usually dislike constants for the sake of having constants. Does CONTENT_DEPENDENCY_FIELD_ARRAY_NAME_KEY give you any value over 'name'? I doubt. Also, using CONTENT_DEPENDENCY_DISPLAY_NO_ENTITY_BLOCK as a ... what? variable? is simply broken, it's a constant, you shouldn't expect people to edit the module. Rather use variable_get('content_dependency_... and then it can be overridden from settings.php.
The class is unnecessarily verbose. For example, getEntityTypesArray should be just getEntityTypes. fullTargetEntityTypesField or content_dependency_execute_hook_filter_entities_edit_build is some Java-like naming. We do not need AbstractSingletonProxyFactoryBean kind of naming, do we :) ?
For getCurrentNodeContentType I highly recommend menu_get_object.
Comment #33.0
(not verified) commentedAdd old & new bonus reviews