Timeline for Create a field (defined within same module) during module installation?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 10, 2017 at 12:45 | vote | accept | Gianni Di Falco | ||
Feb 10, 2017 at 12:40 | comment | added | Gianni Di Falco | Hmmmm i did not know that! Ty, let me try it | |
Feb 10, 2017 at 12:39 | comment | added | Wim Mostrey |
Exactly, you need to add the updates in hook_install() as well.
|
|
Feb 10, 2017 at 12:35 | comment | added | Gianni Di Falco | I'm using a ´hook_install()´ but the updates function are not called in there, they are only defined in .install file. Running the code in a page callback from a item url defined in a hook_menu works. I have to mannualy add the updates inside the ´hook_install´ implementation function? | |
Feb 10, 2017 at 12:31 | comment | added | Wim Mostrey |
hook_update_N() doesn't get called when you install a module. Your version will automatically be set to your latest update function. So you need to implement a hook_install() or hook_enable() . Apart from that, does your code work when you manually call mymybase_update_7200() ?
|
|
Feb 10, 2017 at 12:26 | comment | added | Gianni Di Falco |
Sorry, i did not mention it but i'm using the reinstall module feature from the devel module to test this out. In my .info file the version is version = 7.x-2.0 so my function update should be called *_7200. By seeing the schema_version get update i'm guessing that the updates are fired but he code inside just does nothing
|
|
Feb 10, 2017 at 12:08 | history | answered | Wim Mostrey | CC BY-SA 3.0 |