Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
14 Jan 2012 at 21:20 UTC
Updated:
15 Dec 2012 at 11:37 UTC
Relation clone provides support for Relation when using the Node clone module.
With this module enabled, selected relations are copied to the new node when a node is cloned. This can save time when setting up many similar nodes in a site.
Sandbox link: http://drupal.org/sandbox/wqmeng/1405168
Drupal core version 7.x
Comments
Comment #1
thantthet commentedYou have some issues with drupal coding style. http://ventral.org/pareview/httpgitdrupalorgsandboxwqmeng1405168
and you will have to work in separate git branch rather than in master branch. more information http://drupal.org/node/1127732
PS: set category to task.
Comment #2
wqmeng commentedFixed all errors from http://ventral.org,
Thank you.
Comment #3
wqmeng commentedAdded a screenshot to the resources of the sandbox project.
Comment #4
themebrain commentedReview 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.
Source: http://ventral.org/pareview - PAReview.sh online service
Manual review
- Not use concate string for input of t function, change to use placeholder, and make it more readability:
Comment #5
wqmeng commentedFixed the Concatenating translatable strings on line 65, and also added messages to display the new created relations just cloned.
Comment #6
wqmeng commentedComment #7
wqmeng commentedAdd the screen-shot here to help for understanding.
relation clone screen-shot
Comment #8
gaëlgAutomatic review reported no problem.
Manual review:
The API seems to be used correctly, except for one point: as said before, you should use placeholders in your t() functions.
t('My name is %name', $replacements)is better thant('My name is') . ' ' . $name.And 3 minor details:
$node->relation_cloneis not such a clear name. Something like$node->relation_clone_source_nidwould be more self-describing.relation_insert()"inside" a call todrupal_set_messageis correct but unclear. I would separate this into 2 lines. We save the relation, then we output a message to the user.Comment #9
wqmeng commentedThank you for your review and suggestion. Have fixed the API mistake and others problems. And be better now.
Thanks
Comment #10
wqmeng commentedComment #11
lucascaro commentedAuto review is still good.
A manual review reveals that:
* Beware of name space conflicts, there are no problems right now but there is a relation module that could implement a function named relation_clone_xxx
I would consider renaming the module but that could be done later.
* There are several lines that go over 80 characters (minor).
* line 64 in relation_clone.module:
- Goes over 80 characters.
- Concatenates t() calls which could lead to a problem when translating.
I'd suggest separating the links to make it clearer. and usgin something like
Seems way more readable.
Everything else looks good to me.
Comment #12
aaronelborg commentedHey wqmeng.
I'd like to review your module but it looks like your repo is now on the Master branch alone.
.....which I think is fine for your README file but not for your other files which aren't showing since they're probably on your other, working branch.
You probably wanna fix that, no?
EDIT: And not to pick gnits, but the only text within the readme is "See major version branches." which, technically, isn't all that helpful. OK....I'll stop. ;-)
Comment #13
lucascaro commentedhey @AaronELBorg the branches seem good to me, there's an empty master with a dummy README.txt and there's a 7.x-1.x branch with the module, created 5 weeks ago.
see
http://drupalcode.org/sandbox/wqmeng/1405168.git/tree/refs/heads/master
and
http://drupalcode.org/sandbox/wqmeng/1405168.git/tree/refs/heads/7.x-1.x
So technically the text in README.txt is right.
Also, setting to needs work from #11
Comment #14
aaronelborg commentedlucascaro,
You got me again.
Granted, I still had to switch from the master branch to the 7.x branch manually but, yes, the files are there (after the switch).
I don't know what you mean here though:
Comment #15
lucascaro commentedOh, sorry @AaronELBorg, that's just that I forgot to set the status to "needs work" after my review in comment #11 :)
Comment #16
wqmeng commentedThank you all for reviewing this module.
I think maybe we can use Node Relation Clone to avoid the name space conflicts.
I will commit a new file soon to make it more readable.
Comment #17
aaronelborg commentedI like this module. Can't believe that it's not baked into Node Clone.
wgmeng, I think the new name sounds like a good idea.
Comment #18
lucascaro commentedI agree with @AaronELBorg. Also, keep in mind that according to http://drupal.org/node/299070 the _ in a short project name is the part that could cause problems, but hey! there are lots of projects that use _ so it's just an FYI just in case you didn't already know :) (sorry if it's only adding noise).
Let us know when you have pushed your changes so we can review! (don't forget to set it as needs review).
Cheers!
Comment #19
wqmeng commentedHello,
Just commit a file to fix the string concatenates problem.
For the name space, I just keep it as the current name, until there is a necessary change for it. Once the relation module or the node clone module need to get the clone method to be their part, I am glad to move on.
I have tested the new commit on my site, work fine.
Thank you all.
Comment #20
Milena commentedHello,
Please remove your master branch and add yor 7.x-1.x branch as default on version control tab. It's a good practise, even though documentation page do not mention it (because of CSV migration I believe).
On line 98 you have ; char after closing bracket. It is not neccessary.
On line 13 and 62 you use quotations mark for strings. It makes php parse those string searching for any variables to render. It is PHP good practise to use ' in such situations. It's also Drupal practise to use the same type in your functions and you are using aphostropes for other strings already.
You should place full stop at the end of each comment.
But otherwise your module looks good. These should not be RTBC blockers. I've installed your module and it works fine for me.
Consider participating in Review bonus to get your application reviewed sooner.
Comment #21
patrickd commentedComment #22
patrickd commentedYour project page is not very detailed, please have a look at the tips for a great project page, you may also use HTML-tags for better structure. Also your readme isn't very long, try to keep readme and page in sync.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch
This seems like you rely on the base node_form, so rather to check whether you are on the right form by just checking whether '#node' exists, use the form id "node_form" and hook_form_FORMID_alter(). Otherwise there's a chance that you mess up all other forms that also have this '#node' key.
I'm pretty sure array_keys(array_filter($node->enable_clone_relation)) would do the same
Please try to never use such short variable names like $r, it's hard to guess what they're good for. (at least $rel would be fine for me)
It makes no sense to state that "relations will be copied" - but they won't if you untick the checkbox. Just remove that message and avoid access the $_POST globals directly.
Please try to fix those and I'll have a final look
Comment #23
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.