<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Development Notes &#187; Hook</title>
	<atom:link href="http://blog.eood.cn/tag/hook/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eood.cn</link>
	<description>PHP, Drupal, Erlang, MySQL, Java, MongoDB, Linux, vim, ssh, screen etc</description>
	<lastBuildDate>Sat, 31 Dec 2011 12:49:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to set the module weight in Drupal</title>
		<link>http://blog.eood.cn/how-to-set-the-module-weight-in-drupal</link>
		<comments>http://blog.eood.cn/how-to-set-the-module-weight-in-drupal#comments</comments>
		<pubDate>Mon, 08 Feb 2010 12:26:37 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Life & Work]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Hook]]></category>
		<category><![CDATA[Order]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=782</guid>
		<description><![CDATA[Drupal Hook Execution Order Hook,Drupal,Order Drupal widly uses the hook functions. If some hooks dependente on the other hooks, but they executed before the dependence, it will show the error result. We should set the executation sequence of the same hooks. Add the following code in the module.install file: /** * Implementation of hook_install(). */ [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-796 alignright" title="drupal1" src="http://blog.eood.cn/wp-content/uploads/2010/02/drupal1-150x150.gif" alt="" width="150" height="150" />Drupal Hook Execution Order</p>
<p>Hook,Drupal,Order</p>
<p>Drupal widly uses the hook functions. If some hooks dependente on the other hooks, but they executed<br />
<strong>before</strong> the dependence, it will show the error result. We should set the executation sequence of<br />
the same hooks.</p>
<p>Add the following code in the module.install file:</p>
<p>/**<br />
* Implementation of hook_install().<br />
*/<br />
function hide_clinet_relationship_install() {<br />
// Set the module&#8217;s weight high so that it runs after other modules.<br />
db_query(&#8220;UPDATE {system} SET weight = 9999 WHERE name = &#8216;hide_clinet_relationship&#8217; AND type = &#8216;module&#8217;&#8221;);<br />
cache_clear_all();<br />
}</p>
<p>So the hooks in module hide_clinet_relationship will execute at last.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/how-to-set-the-module-weight-in-drupal/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.065 seconds. -->
<!-- File not cached! Super Cache Couldn't write to: wp-content/cache/wp-cache-d36eab9404ef419a41081ef250675c5c.html -->

