Flexiconvert 5 doesn't display fields created with flexinode's Filtered HTML

noid - January 5, 2008 - 14:22
Project:Flexinode to CCK Converter
Version:4.7.x-1.x-dev
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:needs work
Description

Hi,

If the original flexinode field was created using Filtered HTML, Drupal 5 does not display the converted CCK field -- on page views and, more importantly, edit view. It DOES display the field however in both page and edit views if the field was created using Full HTML.

I've tried to fix this by changing the input format in the database tables before and/or after conversion, to no avail. (e.g. numeric_data column in flexinode_data table, field_fieldname_format column in the newly created content_type_flexinodetype table, and even the format column in the node table.)

Is this a coding problem in flexiconvert -- that is, during the copying of the fields, does it need to specify which text filter was used, and which filter to use later when displaying the field? Or is it possible to manipulate/alter the database -- e.g., convert the fields from Filtered HTML to Full HTML -- perhaps I am missing a table column which I can alter.

For now, my solution is to always use the first field -- the Body field -- when creating the CCK version of a particular flexinode type because it displays ALL the flexinode fields later including in the edit view, which is the most important view. (Drupal can display all the fields after conversion because it seems flexinode stores all the fields in one column -- the Body field of the node_revison table.) The problem with this is, that to edit a post, you have to move the other fields later to their respective text areas, because all the fields are reproduced only in one textarea: the Body textarea.

(Note: I've tried using the 4.7 version prior to Drupal 5 upgrade, but didn't go through with it because I encountered the same problem. Moreover, it didn't display the converted nodes properly -- showed the html code in page views, and in the edit view, the Body textarea is all messed up: too small textarea. So it was easier to work with the Drupal 5 version.)

Thanks in advance! :)

#1

noid - January 5, 2008 - 15:59
Version:5.x-1.x-dev» 5.x-0.2

Correction. I was actually using 5.x-0.2 not 5.x-1.x-dev.

Anyway, my post made me look into the 4.7 version again, and what do you know, I was able to convert the nodes properly without errors (because of my experience with version 5. In particular, if there's an apostrophe or other special characters in your label, delete it first in the flexinode_field table because the conversion would produce MySQL errors.), and the page and edit views of all fields showed, and they displayed properly! I have just one quibble though -- the teaser view is not showing when I use the Views module to display the latest posts. Perhaps this will be fixed once I upgrade to Drupal 5.

So I think that this issue of page viewing and editing is unique to version 5, and should be addressed.

Indeed, the best advice for people planning to upgrade from 4.7 to 5 is to first convert your flexinode posts to CCK in 4.7, THEN upgrade. There's another lesson here -- writing down your problem helps you clarify the problem, and brings the solutions into focus. I've actually already done this in past Drupal debugging, and was reminded of it now. (I think I can use this in other areas of my life :))

Hope this helps someone in the future. :)

#2

noid - January 5, 2008 - 21:55

There's a possibility I might actually need a fix for this because it seems that I wasn't able to download a proper database backup of my 4.7 site. (I upgraded the original 4.7 database, itself, to Drupal 5). I'm still waiting word from my web host if they have a version of the database just before I started the upgrade.

#3

noid - January 6, 2008 - 23:54

Got it! It's a cache_content table issue after all -- http://drupal.org/node/123709#comment-519727 . So you indeed need to download the CVS version -- http://drupal.org/node/133254 -- which has this code

<?php
  cache_clear_all
(NULL, 'cache_content');
?>
.

I replaced the 5.x-0 with the CVs version, 5.x-1, and re-tried the transfer. Initially, it didn't seem to work, but knowing that it may be a cache_content table issue, I emptied the said table, and voila, the new fields now appeared in the page and edit views!

Note: If you commit a mistake in Drupal 5 "flexiconversion" just delete the 'offending' content type, and do this SQL query to bring back the database to its original state:
UPDATE node SET type = replace( type, 'name_of_content_type', 'name_of_flexinode' ) ;

For example UPDATE node SET type = replace( type, 'article', 'flexinode-1' ) ;

I tried a similar process with the 4.7 version, but it deleted all the original node table entries so all of the content disappeared. This is not the case with the 5 version. In this sense, the Drupal 5 version of flexiconvert is easier to use.

#4

anarcat - April 30, 2009 - 17:02
Version:5.x-0.2» 4.7.x-1.x-dev
Status:active» needs work

So it seems HEAD doesn't have this problem anymore. The fix probably needs to be ported to 4.7.x.

 
 

Drupal is a registered trademark of Dries Buytaert.