Unable to import CCK (content_copy_import)
niQo - March 7, 2009 - 16:27
| Project: | Install Profile API |
| Version: | 6.x-2.0 |
| Component: | CRUD functions and includes |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Description
function install_content_copy_import_from_file does not import anything on my fresh drupal 6.10 installation.
Error message :
The import data is not valid import text.

#1
It seems a line is missing in the code: var $content is not set => eg. $content = ob_get_contents();
Here is a patch which use file_get_contents instead of "ob_" functions.
#2
The install_content_copy_import_from_file() function requires an opening PHP tag,
<?php, at the top of each CCK export file.I agree that this behaviour is a little strange, since install_views_ui_import_from_file() doesn't require an opening tag and install_node_export_import_from_file() doesn't require an opening tag.
The counter argument is that having an opening tag at the top of each ".inc" file is important for security. On a misconfigured apache installation the CCK/views/node_export dump would be viewable in the browser (given a direct URL to the dump file).
#3
Closing this, the issue appears to have died off or been resolved.