hi,
i hav created cck with drupal 6. but when i try to impor all the fields of cck.
it gives the following error:

The import data is not valid import text.

Plz tell me the reason.
Thanks

Comments

aakanksha’s picture

no one knows the reason????

Anonymous’s picture

I also have the same problem.. :(

JohnnyMoney’s picture

Having same issue. Going to try switching to plain text...

Looking inside the content_copy.module, which is part of CCK and find the error message here:

// Preliminary error trapping, must have valid arrays to work with.
if (!isset($content) || !isset($content['type']) || !is_array($content) || !is_array($content['type'])) {
form_set_error('macro', t('The import data is not valid import text.'));
return;
}

*****************************
Drupal Projects Homepage (English): www.grandmacarmen.com
Drupal Video Tutorials (Spanish) : www.drupalcarmen.com

robeano’s picture

Exclude your WYSIWYG editor from the Export form. If you do not, the generated export is invalid (doesn't matter if you switch to plain text) e.g. do you see something like this:

'name' => 'My New CCK Type',

the => just won't work on an import.

To fix with the FCKEditor,

* go to Administer -> Settings -> FCKEditor settings
* click edit for FCKeditor Global Profile
* add this path: admin/content/types/export.edit-export to the Fields to Exclude List
* then export your CCK type again

That new export should import.

Robin Barre

Robin Barre

kricklin’s picture

Works great.

Note:

Remember to select "Switch to plain text editor" before pasting the Export data into the "Import data:" window, as I still got the same error when attempting to Import via WYSIWIG after following Robin's instructions. I'm using Drupal 6.19 and CKEditor 3.4.1.

paultrotter50’s picture

Great solution Robeano thanks,

I second Kricklin's comment. Do remember to switch to 'Switch to plain text editor' before you paste into the import page, as if you do it afterwards the import will fail.

futuresoon’s picture

opening <?php tag has solved this for me in the past, for example in an include file, or what-not

mitchell’s picture

+1

juanjo_vlc’s picture

It works for me, as simple as add the php start tag.
Thanks

sassafrass’s picture

Thanks so much for this post futuresoon! I spent hours trying to figure out why this wasn't working and was about to give up on it. But simply adding the opening <?php tag resolved the issue.

Lynn Haas