Description:
This module makes it easy to clone Drupal Commerce products by simply pre-populating the product creation form with all of the data from an existing product. Someone will eventually come out with an entity_clone module that will make this obsolete I'm sure. I built this to take care of some immediate needs.
This module is very similar to node_clone (clone). I started from the ground up and implemented the different pieces from that module that applied to what I'm trying to achieve here (with many modifications, or course). Regardless of how different or similar this module is, I am thankful for the efforts of the node_clone authors.
The module has been requested many times and seems like it'll be a hit.
Link
http://drupal.org/sandbox/agileadam/1540050
Git Clone
git clone --recursive --branch 7.x-1.x git.drupal.org:sandbox/agileadam/1540050.git
Core Version
Drupal 7
Other Reviews
Coming soon... just learning about Review Bonus.
Thanks for your time!
-Adam
Comments
Comment #1
mariooo commentedAutomatic 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.
PAReview details available here: http://ventral.org/pareview/httpgitdrupalorgsandboxagileadam1540050git
Manual review of the 7.x-1.x branch:
Aside from this looking good to me, don't see anything else of concern other than that already noted in PAReview, works well. Unfortunate that the node_clone module is for nodes only, otherwise this would be a nice extension. A decent solution until entity_clone comes around.
Comment #2
patrickd commentedThere aren't any major issues in the automated report,
also the "manual review" is wrong: DO NOT use t() within hook_menu().
Therefore changing back to needs review.
Comment #3
agileadamThanks for reviewing, mariooo. I've cleaned up everything I can from your PAReview check. I'm not sure what's going on with the line endings at the end of the files. Maybe you can advise?
I do not believe I need to use t() in my hook_menu titles and descriptions. See http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
Thanks again!
Comment #4
mariooo commentedSorry agileadam, you're right about hook_menu and t().
Re line-endings looks like you have 2 newlines instead of 1 at the end of .module/.inc, but as patrickd mentioned, not a major issue.
+1 for RTBC.
Comment #5
megensel commentedcommerce_product_clone.module:77
$access = user_access('clone product') || ($user->uid && ($product->uid == $user->uid) && user_access('clone own products'));I would suggest using "===" instead of "==" to make sure you're not accidentally comparing against a boolean value. More of a suggestion though then an issue...
Comment #5.0
megensel commentedUpdated git clone information; minor description changes.
Comment #6
agileadamAh! Good suggestion. Fixed 7365e31..68b5e83.
Comment #7
AngryWookie commentedEverything looks pretty solid to me. My testing of the functionality didn't show any errors and reviewing the code the only thing I see that looks out of place is that there are 2 blank lines at the end of the .module and .pages.inc files instead of just 1.
Other than that the only suggestion I can offer is that it'd be nice from a usability standpoint if hitting "save and add another" when on the clone tab it would prefill the information again rather than taking you to a blank product screen.
Comment #8
donaldp commentedI've installed this onto my test site based on Commerce Kickstart 2. However, although I can see and change the Clone configuration and the clone permissions, I can't find any "clone" tabs, buttons or drop down lists on any of the product pages or lists. I'm not sure what I should be seeing, other something like the images on the sandbox page, but should there be an additional "Clone" tab for each product page along with "View" and "Edit"?
With the Kickstart 2 configuration the product list does not appear to be as the images on the sandbox page. The options by each product are in a drop down list which has the options: "Quick Edit", "Edit" and "Delete" only. This has not changed after the module was installed. Any ideas how to get this working?
Comment #9
agileadam@AngryWookie thanks for the tip on the blank lines. I've removed them in the latest commit. I was duped by the "All text files should end in a single newline (\n)." declaration in the coding standards docs.
@donaldp I'm sorry it's not working with Commerce Kickstart. The module works with the out-of-the-box setup (manual, not Commerce Kickstart) of the product list view and the product edit form. According to http://www.drupalcommerce.org/commerce-kickstart-2/products they are using Commerce VBO and Views Mega Row, which I've not used before. I'm not sure what may be going on with the tabs on the product edit screen. I'll install Commerce Kickstart 2 and see what's up.
Thanks for your feedback!
Comment #10
stborchertFinal review.
Comment #11
stborchertCongratulations: your are now a vetted git user and from now on you are allowed to create full projects.
Some minor notes:
function commerce_product_clone_help()should be "'admin/help/commerce_product_clone'"But these notes do not block your application, they are just simple hints to make your great module a little better :)
Comment #12
agileadamThanks stBorchert!
This is awesome news on a cold Sunday morning! I'll make the changes you suggest.
Cheers,
Adam
Comment #13
agileadamstBorchert,
After reading through http://api.drupal.org/api/drupal/modules!help!help.api.php/function/hook... again, I think I used the right path for the help text. Maybe I'm misunderstanding the docs?
Let me know,
Thanks again,
Adam
Comment #14
klausimanual review:
But that is surely no blocker and the approval is fine.
@stBorchert: please also use the template from http://groups.drupal.org/node/184389 when approving applications:
Thanks for your contribution, agileadam!
stBorchert 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 #15
agileadamThanks for all of the information klausi! I'll make sure I understand and comply with all of it.
Also, I've made the change you outlined. I am looking at the docs for drupal_set_title() and notice the $output param defaults to "CHECK_PLAIN." Thanks for the tip!
Cheers,
Adam
Comment #16
stborchertNo, sorry. I was wrong.
Help module is using
#to identify the module via path and creates the list of modules without using the path specified in the implementations ofhook_help(). This path is simply used to identify the module.Comment #17.0
(not verified) commentedUpdated other reviews section