I'm upgrading from 4.7 to 5.1 and had most all of my site in flexinodes. I set myself up a test site and installed 5.1 with flexiconvert. I did one flexinode type and found that it imported the fields into the equivalent field, but it also put all of the fields into the body section (which I used as one of my fields from my old one). It looked like this:

old flexinode:
Field: General Info
Field: location
Feild: Steps

CCK node:
Body: General Info
Field: Location
Feild: steps

the resultant body portions contained the whole content of the old node, even though the location and steps were converted correctly. Has anyone run into this? Can I not use body? Do I have to make them all fields? I'm ok with that, just wondering why it acted the way it did so I can figure out how to get my site moved over most effeciently.

Comments

anner’s picture

I tried not using the body field, but it still puts the entire flexinode there and displays it. ? ideas?

agentrickard’s picture

All the fields are in the body because that's how Flexinode used to store and display its fields. It would create <div> tags with data and insert them into node body at the database level.

I "fixed" this by removing body and teaser text from the database after doing flexiconvert. But it's a little tricky. The safe way is to write a script to loop through the node table, find nid/vid of all nodes of type X, and then run an UPDATE against node_revisions to make body and teaser into blank strings ''.

If you remove the body and teaser elements from the database, CCK will create new ones on-the-fly from the data it has stored.

You could do this in SQL, but I think it requires a subquery. This might work:

UPDATE {node_revisions} nr INNER JOIN {node} n ON n.vid = nr.vid SET nr.body = '', nr.teaser = '' WHERE n.type = '$string';

Where $string is the CCK node type you created. And {tablename} indicates possible table prefixing if you use that.

DO NOT RUN THE ABOVE CODE ON A LIVE SERVER. it may horribly fail.

Here's a safe query you can run to test the logic above.

SELECT nr.nid FROM {node_revisions} nr INNER JOIN {node} n ON n.vid = nr.vid WHERE n.type = '$string'

On my test server, this works as expected:

SELECT nr.nid FROM node_revisions nr INNER JOIN node n ON n.vid = nr.vid WHERE n.type = 'blog';

--
http://ken.blufftontoday.com/
http://new.savannahnow.com/user/2
Search first, ask good questions later.

brunodbo’s picture

Cool, works perfectly. Thanks.

--
Don't hate the media, be the media -- www.indymedia.be

brunodbo’s picture

Only thing is:

If you remove the body and teaser elements from the database, CCK will create new ones on-the-fly from the data it has stored.

This doesn't seem to happen. In fact, CCK doesn't populate the body and teaser fields in node_revisions, not even when creating new nodes. On the site though, it shows the data stored in the CCK tables, even though for node titles it looks at node_revisions (=> when I remove a title from node_revisions, the title is gone on the site: so node_revisions isn't upading node title either).

Strange.

brunodbo’s picture

See http://drupal.org/node/107590

--
Don't hate the media, be the media -- www.indymedia.be

t10barba’s picture

this fix work perfect with my flexinode 4.7 -> cck 5.5 problem.

*******
IGUANA!