[development] The state of import export

Roman Chyla roman.chyla at gmail.com
Wed Jan 30 16:36:39 UTC 2008


Hi,
i am trying to have some introspection of the forms, tried various
things to get the document type's form array
I even serialized the array passed to this function
$form = call_user_func_array('drupal_retrieve_form', $args);

it works when I go to /node/add/page

but if I try the same thing from the command line, eg.
$args = unserialize('a:3:{i:0;s:14:"page_node_form";i:1;a:3:{s:7:"storage";N;s:9:"submitted";b:0;s:4:"post";a:0:{}}i:2;a:4:{s:3:"uid";s:1:"1";s:4:"name";s:5:"admin";s:4:"type";s:4:"page";s:8:"language";s:0:"";}}');
$form = call_user_func_array('drupal_retrieve_form', $args);
print_r($form);
I got completely different array


Can you please point me to the right direction? I must be missing
something obvious. how do i get the form tree array before it is
converted to the html form?
Thanx

  roman

On Jan 29, 2008 11:42 PM, Simon Hobbs <emspace.com.au at gmail.com> wrote:
> On Jan 29, 2008 11:45 AM, Roman Chyla <roman.chyla at gmail.com> wrote:
>
> > however, would it be possible with Drupal to do something like this?
> >
> > $new = get_new_node('article');
> > $new->add('title', 'Hello world');
> > $new->add('userid', 1);
> > $new->commit;
> >
> > basically, the new import function would only have to construct the
> > node object and submit it to Drupal
>
> Hi Roman
>
> There would be nothing to prevent any examples in this thread being
> made into a class with methods like 'add' and 'commit'. The challenge
> is having working code inside the black box.
>
> Simon
>


More information about the development mailing list