Magento - install the script does not work (but the record is correctly added to core_resource)

So, I am trying to run setup script with my module. (Magento 1.7) I have my config.xml modules

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Sulman_Custompermissions> <version>1.0.0.0</version> </Sulman_Custompermissions> </modules> <global> <resources> <mymodule_setup> <setup> <module>Sulman_Custompermissions</module> </setup> </mymodule_setup> </resources> </global> </config> 

This is my file structure for installing the script: / app / code / local / Sulman / Custompermissions / sql / mymodule _setup / install-1.0.0.0.php

Then in my install-1.0.0.0.php script the following just executes:

 die('here'); 

The problem is that the installation of the script never starts (nothing dies). but there is a row correctly inserted into the core_resource table ... Any hints? Thanks

(ps if there is an entry in the core_resource table, it is deleted before I try to run the script)

+4
source share
3 answers

Based on the fact that your config XML module is merged (hence the entry in core_resource ) and assuming that the XML in your message is a copy of this content, there are three possibilities:

  • File system hierarchy: you have a typo in your file name, folders, or incorrect folder structure.
  • Permissions: PHP cannot include() contents of your file
  • There is a duplicate config.xml that points to a different subdirectory, and this file is not actually merged.

Solutions:

  • Look look look
  • Check permissions, test script directly
  • grep , cancel the XML configuration file in the file you are working in and / or dump the XML configuration for the xpaths in question:

     echo Mage::getConfig()->getNode('modules/Sulman_Custompermissions/version'); echo Mage::getConfig()->getNode('global/resources/mymodule_setup/setup/module'); 
+4
source

Change your config.xml to 1.0.0.0

 <global> <resources> <mymodule_setup> <setup> <module>Sulman_Custompermissions</module> </setup> <connection> <use>core_setup</use> </connection> </mymodule_setup> </resources> </global> 

and change the name of the script installation file to mysql4-install-1.0.0.0.php and delete the entry from the core_resource table and clear the cache and check ....

0
source

Make sure your config.xml names the module as it appears in your sql directory. For me, I had sql-> customizations_setup, and this worked fine with capital letters:

  <Customizations_setup> <setup> <module>AMI_Customizations</module> <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </Customizations_setup> 

But this only worked because my local machine was case insensitive. My production server (linux) is case sensitive and it will create an entry in the core_resource ok file, but from there it will not create db entries until I make xml match the name of my directory:

  <Customizations_setup> <setup> <module>AMI_Customizations</module> <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </Customizations_setup> 
0
source

Source: https://habr.com/ru/post/1482991/


All Articles