I'm excited about this module, thanks for all your had work on it. But I'm running into errors when I try to deploy a node that has a taxonomy field associated with it.
The node form has a "manufacturer" taxonomy field where you would choose a manufacturer from a select menu. The node type and the taxonomy terms are already set up on both the staging and live servers. Pathauto uses the taxonomy term in the resulting node path (/{manufacturer}/title...).
If I update a node that exists on both servers and try to deploy the update to the live server, I get the following error message:
Manufacturer field is required. The path is already in use.
If I create a new node and try to deploy it to the server, I get this message:
Manufacturer field is required.
Yet, I set the Manufacturer field when I both updated and created the nodes.
Does Deploy not yet work for deploying nodes that have taxonomy fields? Or do I need an updated version of the taxonomy module or CCK module? Here's what I'm using:
- Drupal 6.10 (w/ Taxonomy 6.10)
- Deploy 6.x-1.x-dev (mar 20)
- Services 6.x-1.x-dev (mar 7)
- CCK 6.x-2.2
Any thoughts on what's going wrong? Thanks for your help!
Comments
Comment #1
gddWas your live server already populated with data when you setup Deploy? This calls for a somewhat different installation procedure that I haven't documented yet and I can see how that situation would cause the error you're seeing.
Comment #2
aasarava commentedYes, that's correct. The live server already had data when I set up Deploy. How hard would it be to install Deploy for this scenario? By the way, I can contribute $100 for your time to help explain and will help write up the documentation more formally afterward. Thanks!
Comment #3
aasarava commentedActually, I just some print_r statements in node_deploy.module, in the node_deploy() function, and I see that something might be wrong with the taxonomy loop that re-organizes the array.
Before the array is reorganized,
$node->taxonomyis:Array ( [1] => Array ( [0] => 3 ) )Afterward, it's empty:
Array ( [] => Array ( [] => ) )That would explain why on the receiving end the attempt to insert the node is failing with a required field error. No data is getting sent for that field.
What do you think? Thanks!
Comment #4
gddThat is a little strange. In theory it should go like this
1) Taxonomy items check to see if they exist on remote host
2) No? Add them to the list to be deployed (this should be happening to you)
3) Deploy them. If it fails, stop.
So in theory you shouldn't be getting to the nodes at all. Unless the terms/vocabs got kind of half-saved, which is possible. The taxonomy API is kind of ... half-assed is putting it kindly.
Deploy works by assigning GUIDs to content, which allows it to check the existence of content from one site to another even if the primary keys are different. Therefore, installation into an existing site works like this
1) Get your live and dev servers to a point where they're the same (for instance by doing a mysql_dump of one to the other.)
2) Install deploy on the dev server. This creates GUIDs for all the existing content pieces.
3) Do another mysql_dump from dev to live. This assures that the GUIDs on each server match and can now verify against each other.
You got messed up by installing deploy fresh on both, so the GUIDs are completely different. What I would do in your case is:
1) Uninstall Deploy on your live server (should be a complete uninstall, not just disabling the module, to assure the tables get wiped.)
2) mysql_dump your dev server to live.
I realize this can be a little tricky depending on what is going on with your live site, but it really won't work any other way. Let me know if you have any problems.
I will look into the possible issues with the taxonomy push.
Comment #5
aasarava commentedThanks for your help, heyrocker! I think we're making progress.
I followed your instructions and did a mysql_dump from dev to live. Now I can deploy changes to nodes and new nodes from dev to live. The taxonomy problem seems to have gone away, so it's probable that the "missing taxonomy array" issue I noted in my earlier message was just due to the incorrect GUIDs, not due to a bug in the code.
However, I can't seem to deploy nodes that have noderefences. Whenever I create a new node of a type containing nodereference fields, and then try to deploy it, I get the following error message:
(The "Review" field is a nodereference to a Review node type.)
Also, the images (via imagefiled) in my nodes aren't getting copied over from dev to live. Likewise, path alias changes to nodes on dev are not getting copied over. I'm not sure if these should be getting copied and is somehow broken because of an error in my setup/config process, or if these are separate support issues. Any pointers?
Thanks!
Comment #6
gddOK so a couple things.
For nodereferences, please verify that you have the "Deploy Nodereferences" module enabled on your dev server.
For image/file fields, there is currently no code in Deploy right not to handle it. I actually have code here which supports it, but the code is dependent on a patch to Services #376226: Add a file save service, and thus I haven't checked it in until that patch lands. If you would like to try that, I can put it in my sandbox for you to get and you can apply the patch to Services and it should work.
Comment #7
aasarava commentedYup, the Deploy Nodereferences module is enabled on dev, which is why it's strange. Maybe I'll try re-installing.
I'd love to get the code you use for supporting file deployment. I've already patched services. Thanks!
Comment #8
gddOut of curiosity are you using a select widget or autocomplete for your nodereference? I'm doing some form munging stuff and it might make a difference (I've had some concern about this but hadn't tested it.)
I'll post the file deployment code in the morning, its getting late and I've not used my sandbox for a while.
Thanks for your help testing, haven't had a lot of generalized usage yet.
Comment #9
aasarava commentedI'm using a select widget for the nodereference.
No rush on getting the file deployment code. Monday would be great if you get a chance.
Comment #10
gddTry using the autocomplete widget, and see if the nodereferences work. You might need to resave the node to get it to take. I'll try and look at this sometime this weekend, although I have a lot going on unfortunately.
In the meantime I have committed the filefield_deploy module to my sandbox if you want to play around with it. You should be able to check it out of cvs or grab it here
http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/heyrocker/
I also added taxonomy_deploy which you don't have either, which I forgot about. THAT module is ALSO waiting on a services patch
#401586: Taxonomy term and vocabulary save services
Which you can apply if you want to use it. There's no problem with taxonomy right now because your two sites match exactly. As soon as you add more terms its all up for grabs.
Both those modules would go in sites/all/modules/deploy/modules and then need to be enabled.
Comment #11
gddThere's a separate issue for the nodereference bug, and filefield support is in process. I think that finishes the outstanding issues here so i'm closing this unless you have something else to address.
Comment #12
iamjon commentedi had the same error with Taxonomy's that were almost identical between two sites, but one was translated the other wasn't
I just turned of the required on both sites. It worked (the term was properly assigned.) Once they were imported I turned required back on.