Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49197

Programatic CCK Now Possible!

$
0
0

I just wanted to point out a very important change to content_copy.module that makes it much more fasible to create CCK field programatically as part of an install profile. As of last week, the DRUPAL-5 CVS version of content_copy.module no longer ends content_copy_import_form_submit() with a drupal_goto().

Previously, if you attemted to import a CCK node-type using drupal_execute(), your script would redirect to an admin page, which is problematic during an install profile as it short-cirtuits the process. This is no longer the case.

You can now run code similar to the following:

<?php
 
include_once './'. drupal_get_path('module', 'node') .'/content_types.inc';
  include_once(
'./'. drupal_get_path('module', 'content') .'/content_admin.inc');
 
$values = array();
 
$values['type_name'] ='<create>';
 
$values['macro'] = /** YOUR CCK EXPORT DUMP HERE **/
 
drupal_execute("content_copy_import_form", $values);
?>

And continue with your install script. Happy profiling!


Viewing all articles
Browse latest Browse all 49197

Trending Articles