Did you try drupal_execute()?<br><br><a href="http://api.drupal.org/api/function/drupal_execute/6">http://api.drupal.org/api/function/drupal_execute/6</a><br><br>As Ezra said, see the previous discussion thread for the pros and cons to this approach.<br>
<br>- Ken Rickard<br>agentrickard<br><br><div class="gmail_quote">On Tue, Apr 1, 2008 at 2:45 PM, Kyle Mathews <<a href="mailto:mathews.kyle@gmail.com">mathews.kyle@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Node_factory is a great idea for a module as this problem, creating<br>
nodes programatically, seems to come up all the time. It'd be great if<br>
best practices could be put into node_factory. I used it recently to<br>
create a custom module using workflow_ng and node_factory to auto<br>
create nodes and it worked great.<br>
<br>
Kyle<br>
<div><div></div><div class="Wj3C7c"><br>
On Tue, Apr 1, 2008 at 11:45 AM, Clemens Tolboom <<a href="mailto:clemens@build2be.nl">clemens@build2be.nl</a>> wrote:<br>
> I'm trying to build this module <a href="http://drupal.org/project/node_factory" target="_blank">http://drupal.org/project/node_factory</a><br>
> which seems to be not trivial.<br>
><br>
> It work fine with simple node types without cck or Access Control<br>
> modules like og.<br>
><br>
> With the discussion mentioned by Ezra B. Gildesgame and some love from<br>
> some developers I hope to make the module better.<br>
><br>
><br>
><br>
> On Tue, 2008-04-01 at 09:05 -0700, Sean Wingert wrote:<br>
> > Is there a (programmatic?) way to add a node *without* using node/add/something and still gain access to hook_validate(), hook_insert(), hook_update(), and hook_delete()? I'm trying something like this but hook_validate does not seem to fire...<br>
> ><br>
> > function property_menu($may_cache) {<br>
> > $items=array();<br>
> > // Do not cache this menu item during the development of this module.<br>
> > if (!$may_cache) {<br>
> > $items[] = array(<br>
> > 'title' => t('Review'),<br>
> > 'path' => 'property/create',<br>
> > 'access' => user_access('create property'),<br>
> > 'type' => MENU_LOCAL_TASK,<br>
> > 'weight' => 1,<br>
> > );<br>
> > }<br>
> > return ($items)<br>
> > }<br>
> ><br>
> > function property_validate($form_id, $form_values) {<br>
> > //validate property number<br>
> > if (!preg_match('/^\d{1,4}$/',$form_values['pnum'])) {<br>
> > //watchdog('security',t('Bad property number entered'), WATCHDOG_WARNING);<br>
> > form_set_error('pnum',t('The property number does not appear to be valid. It should be 3 numbers long.'));<br>
> > }<br>
> > }<br>
> ><br>
> > Thanks!<br>
> ><br>
> > Sean<br>
> --<br>
> Clemens Tolboom<br>
> build2be<br>
> KvK NL020994130000<br>
><br>
> <a href="mailto:info@build2be.nl">info@build2be.nl</a><br>
> <a href="http://build2be.nl" target="_blank">http://build2be.nl</a><br>
> +31(0)6 10 27 96 95<br>
><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Research Assistant<br>
eBusiness Center @ BYU<br>
<a href="http://kyle.mathews2000.com/blog" target="_blank">kyle.mathews2000.com/blog</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ken Rickard<br><a href="mailto:agentrickard@gmail.com">agentrickard@gmail.com</a><br><a href="http://ken.therickards.com">http://ken.therickards.com</a>