Things that can go wrong with your views export
Sun, Nov 29, 2009 by alla
I exported a view to another server and lost it, but it was right there, in my code, anyone could see it there - yet not in a list of views. What happened? – Well, after all, it appeared to have an easy explanation:
When I exported my view and put it into hook_views_default_views function, I forgot that I also needed to export some content type to which I had added a new field. When Drupal tried to import my view it was looking for the field that did not exist in a database. The result – no imported view whatsoever. No error messages, nothing! I need to mention that this happened in Drupal 5 – maybe a Drupal 6 would have given me a little warning? – I never tried to repeat my mistake there.
What else can go wrong with your view export?
It can happen that vocabularies in your local working database have different IDs (vids) than those on the production server (let’s say that after taking a database dump from a production server you created and then deleted a couple of vocabularies – the id of the next vocabulary on your local DB will be bigger than the id of the next one in the production DB). You work on your local creating views, export them to a different server and all your new views point to the wrong vocabularies. This is sad. Now you are going to be pretty creative fixing this problem without re-creating all the views or editing exported code (in which all vids are hard coded).
What else can go wrong?.. share some of your experience here!
ultimike posted on December 16, 2009 7:55 pm
I just had a Views Import fail on me not too long ago while attempting to import it on another site because of a CCK text field.
I had defined a CCK text field to use a select box widget. In the list of allowed values were items like this:
This is one.
Here's another
And the last one.
While not using the "key|value" format is perfectly acceptable, the existence of the single quote in "Here's another" caused the import to fail...
-mike
Island Usurper posted on November 30, 2009 9:11 pm
It's less likely to happen than a different vocabulary id, but if Views can't find your CCK fields, it won't import. I had this happen when I decided to combine a couple of test sites into one using Domain Access. Though they both had Imagefields, they were called different things. The Views import UI displayed a helpful message, though.
Post new comment