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 &lt;<a href="mailto:mathews.kyle@gmail.com">mathews.kyle@gmail.com</a>&gt; 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&#39;d be great if<br>
best practices &nbsp;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 &lt;<a href="mailto:clemens@build2be.nl">clemens@build2be.nl</a>&gt; wrote:<br>
&gt; I&#39;m trying to build this module <a href="http://drupal.org/project/node_factory" target="_blank">http://drupal.org/project/node_factory</a><br>
&gt; &nbsp;which seems to be not trivial.<br>
&gt;<br>
&gt; &nbsp;It work fine with simple node types without cck or Access Control<br>
&gt; &nbsp;modules like og.<br>
&gt;<br>
&gt; &nbsp;With the discussion mentioned by Ezra B. Gildesgame and some love from<br>
&gt; &nbsp;some developers I hope to make the module better.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp;On Tue, 2008-04-01 at 09:05 -0700, Sean Wingert wrote:<br>
&gt; &nbsp;&gt; 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&#39;m trying something like this but hook_validate does not seem to fire...<br>

&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; function property_menu($may_cache) {<br>
&gt; &nbsp;&gt; &nbsp; $items=array();<br>
&gt; &nbsp;&gt; &nbsp; // Do not cache this menu item during the development of this module.<br>
&gt; &nbsp;&gt; &nbsp; if (!$may_cache) {<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; $items[] = array(<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &#39;title&#39; =&gt; t(&#39;Review&#39;),<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &#39;path&#39; =&gt; &#39;property/create&#39;,<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &#39;access&#39; =&gt; user_access(&#39;create property&#39;),<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &#39;type&#39; =&gt; MENU_LOCAL_TASK,<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &#39;weight&#39; =&gt; 1,<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; );<br>
&gt; &nbsp;&gt; &nbsp; }<br>
&gt; &nbsp;&gt; &nbsp; return ($items)<br>
&gt; &nbsp;&gt; }<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; function property_validate($form_id, $form_values) {<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; //validate property number<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (!preg_match(&#39;/^\d{1,4}$/&#39;,$form_values[&#39;pnum&#39;])) {<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; //watchdog(&#39;security&#39;,t(&#39;Bad property number entered&#39;), WATCHDOG_WARNING);<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; &nbsp; form_set_error(&#39;pnum&#39;,t(&#39;The property number does not appear to be valid. It should be 3 numbers long.&#39;));<br>
&gt; &nbsp;&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp;&gt; }<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Thanks!<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Sean<br>
&gt; &nbsp;--<br>
&gt; &nbsp;Clemens Tolboom<br>
&gt; &nbsp;build2be<br>
&gt; &nbsp;KvK NL020994130000<br>
&gt;<br>
&gt; &nbsp;<a href="mailto:info@build2be.nl">info@build2be.nl</a><br>
&gt; &nbsp;<a href="http://build2be.nl" target="_blank">http://build2be.nl</a><br>
&gt; &nbsp;+31(0)6 10 27 96 95<br>
&gt;<br>
&gt;<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>