I am creating a custom Magento module, and I cannot get the setup resource script to run. I am following Alan Storm’s tutorial on it, but cannot seem to track down the issue.
I have scaled it down to simply attempt to force an error that my …Model_Resource_Mysql4_Setup cannot be found as per the tutorial, but I cannot even seem to generate that (I get no errors at all).
The module does show up in System->Configuration->Advanced. I have all Magento caching disabled. There are no entries for this module in the core_resource table. What am I missing below? Shouldn’t these two files be enough to generate an exception error such as:
Fatal error: Class 'CBTools_Twilliotool_Model_Resource_Mysql4_Setup' not found in
…since I do not have the class defined in Model/Resource/Mysql4/Setup.php? If so, then I am unfortunately not getting the error.
app/etc/modules/CBTools_Twilliotool.xml
<config>
<modules>
<CBTools_Twilliotool>
<active>true</active>
<codePool>local</codePool>
</CBTools_Twilliotool>
</modules>
</config>
app/code/local/CBTools/Twilliotool/etc/config.xml
<config>
<modules>
<CBTools_Twilliotool>
<version>0.1.0</version>
</CBTools_Twilliotool>
</modules>
<models>
<twilliotool>
<class>CBTools_Twilliotool_Model</class>
<resourceModel>twilliotool_mysql4</resourceModel>
</twilliotool>
</models>
<resources>
<twilliotool_setup>
<setup>
<module>CBTools_Twilliotool</module>
<class>CBTools_Twilliotool_Model_Resource_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</twilliotool_setup>
</resources>
</config>
You’re missing a configuration node. The
<models>and<resource>tags belong inside a<global>tag.