Closed (won't fix)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2009 at 19:03 UTC
Updated:
9 Nov 2011 at 10:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
rszrama commentedJust for reference, here's a related thread in the forums.
Comment #2
rszrama commentedcha0s brought up the idea of an XML export, and that seems like a perfect common ground... human readable enough for us to debug in a forum post but still machine readable for when we get imports working. I like it.
Comment #3
cha0s commentedHere's the first work I've done on this over the last day and a half. Give her a spin and tell me what ya find ^^...
Comment #4
cha0s commentedUpdate; predicate element (conditions/actions) settings are now imexported in a fully human-readable/mutable format! Also, I added much comentarios...
Comment #5
cha0s commentedEr, I made a last minute change before that patch that broke exporting. Also, I was importing actions incorrectly.
Comment #6
Island Usurper commentedMight want to add a dependencies line to ca_export.info.
Just from reading, I don't see any other problems. I'll give it a more thorough review tomorrow.
Comment #7
rszrama commentedDependency++. Not sure about putting an extra module in core yet. Really looking for human readable summary/output still, too. I feel like cha0s and I chatted about this, but I forgot to update the issue or something. :-/
Comment #8
a_c_m commentedAdded the dependency, also changed the menu path and added the menu items to the UI for CA.
Comment #9
cha0s commented+1
Thanks for the improvements. Looks great!
Comment #10
mikejoconnor commentedIt is nice to have these as "human readable", and I'm sure outside developers would rather work with xml than arrays. That being said, I wonder if this is really the best option. Both CCK and Views simply export a text that can be ran through eval() for import. Although that method has a lot of "uglyness", it also allows me to build a predicate through the interface, export it, and embed it in my code with hook_ca_predicate.
I've attached a solution I was playing with earlier today. It is not finished, but it's a good example of the simplicity of a php based import/export.
Comment #12
cha0s commentedHaha, this never even got in?
Comment #13
mikejoconnor commentedoops, includes some stuff in that last patch, which shouldn't be there. I'll resubmit later.
@chaos
Nope, although I think there's a module for it, and this patch always runs locally on my dev box :)
Comment #14
mikejoconnor commentedok, here's a version against a more recent dev release.
Comment #15
tr commentedI'm in favor of adding it in. Can someone review the patch?
Comment #16
jeremy.zerr commentedI just took the patch in #14 and manually copy/pasted in the changes into 2.2 and found that the conditions are being exported with one too many levels of nesting.
Attached is a screenshot of what the Conditions page looks like.
The php code exported was:
The part that should be cleaned up is:
The '#operator' is in there twice, but only should be in there once.
I used this export function to export a CA I created by hand, removed one layer of the double nested part, and then added it to the default CA's created by the uc_node_access module successfully for a project I'm working on.
Thanks,
Jeremy
Comment #17
junedkazi commentedHi,
I created a new module using some of the code from http://drupal.org/node/372290#comment-3056856 .
There was one problem which I noticed in the validate function.
The validate function was validating based on #pid but I thought it could be the wrong way to do it bcoz of the following reason;
1 - If we import the export on a new site which already has some predicates it will throw an error saying the predicate already exists.
2 - The same case is true if we do it on same site the same problem arises.
In the submit function when we submit it we do not consider the pid number to be in incremental order. Refer to this piece of code in ca.admin.inc
This is what ca module does when we create a new predicate. So I tried to implement the same thing in my module.
The project link is as follows
http://drupal.org/project/uc_ca_import_export
Credits for this project goes to
@mikejoconnor for his patch in #14
@all people part of this issue
I would like people to download the module and submit issues against it so that the module can be improved. If anyone wants to join in to improve the module are more than welcome.
Comment #18
longwaveExists in contrib as http://drupal.org/project/uc_ca_import_export and not needed in 7.x now we have Rules.