Closed (fixed)
Project:
Replicate
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2014 at 19:47 UTC
Updated:
8 May 2015 at 18:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jgalletta commentedSorry for the delay but yes, that would be added here, feel free to submit a patch :)
Comment #2
mmilutinovic1313 commentedCurrently working on this as a patch. Updates to come soon!
Comment #3
mmilutinovic1313 commentedHi all,
Here is the code's status. I'm just working on some error checking so that users will get friendly error messages if they enter something invalid. I'll be posting the patch soon after I finish that process. Here is the github link to my work:
https://github.com/mmilutinovic1313/replicate
Comment #4
mmilutinovic1313 commentedHere is the patch. Let me know if it needs any changes!
-Mark
Comment #5
btopro commentedSome critique. account for not including argument 2. If no entityID is supplied then we need to make sure it's accounted for. Shouldn't throw a warning it should throw a message
are both thrown when no ID is supplied
ALso the usage examples when you type drep --help is different then the actual command. Says drush rep node 1 but drep appears to be the call. Make it replicate and maybe rep as the shorthand if you want to use one.
Comment #6
mmilutinovic1313 commentedHere is a new patch, I think this one handles the errors better.
Command: drush replicate
Shorthand: drush rep
Requires 2 params
Let me know if you need anything else added!
Comment #7
btopro commenteddrush_replicate_drush_help is still a placeholder. other then that looking good
Comment #8
mmilutinovic1313 commentedThis invokes replicate_drush_help properly
Comment #9
btopro commentedSee like 47:
This should be a call to
replicate_entity_by_idthen you don't need the last two functions.Also comment / document each function in the
style
Comment #10
mmilutinovic1313 commentedTHIS PATCH DID NOT DIFF PROPERLY. NEW PATCH COMING IN 5 MIN
Comment #11
mmilutinovic1313 commentedOkay this should have the correct simplified formatting and code with proper hook references.
Comment #12
btopro commentedLooks good to me, could use some testing by a third party since in full disclosure mark works for me.
Comment #13
jgalletta commentedQuick code review:
Comment #14
mmilutinovic1313 commentedFixed the formatting listed above! Please let me know if you have any other fixes!
Comment #15
vbouchetHi @mmilutinovic1313,
I updated your patch with various standard fixes but also updated the drush command to accept a list of entity IDs instead of only one. It's of course accepting only one ID if you want to replicate only one entity.
Comment #16
btopro commentedReviewed, looks good to me!
Comment #19
vbouchetThis had been merged, will be available in the next release.
Comment #20
chefnelone commentedIs there a way to replicate a node several times with Drush?
Let say I want to create 5 copies of a node which ID is 174.
Can I do it with Drush?
Comment #21
btopro commentedI mean you could call the drush command 5 times w/ the same ID. Or you could use dev of this to get the replicate drush plugin then write a recipe via http://drupal.org/project/drush_recipes to chain build the item X number of times. this would be pretty easy to do with the looping part of the spec
Comment #22
chefnelone commentedok, which is the command to replicate a node?
Comment #23
btopro commenteddrush replicate node 1,2,3