3 replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
source | link

I know there is a question hook_update_N not runninghook_update_N not running but I checked its answers and it didn't help. I'm just learning developing modules for Drupal so maybe it's something really stupid but I have no idea...

I know there is a question hook_update_N not running but I checked its answers and it didn't help. I'm just learning developing modules for Drupal so maybe it's something really stupid but I have no idea...

I know there is a question hook_update_N not running but I checked its answers and it didn't help. I'm just learning developing modules for Drupal so maybe it's something really stupid but I have no idea...

2 added 1136 characters in body
source | link

Edit:

I created simple module:

testModule.module:

<?php


function testModule_myform($delta = "") {

    $form['something'] = array(
        '#type' => 'markup',
        '#markup' => 'Something',
    );
    return $form;
}



/**
 * Implements hook_menu();
 */

function testModule_menu() {
    $items["test/test"] = array(
        'title' => 'testModule',
        'description' => 'TODO: Description',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('testModule_myform'),
        'access callback' => TRUE,

    );
    return $items;
}

testModule.info:

name = testModule
description = Test module for Drupal experiments.
package = CustomTest
core = 7.x

testModule.install:

function testModule_update_7001() {
    drupal_set_message('It works!');
    print 'Show something!';
}

And it still ignores this hook... Is it officially a Drupal bug and I need to reinstall the whole Drupal? >_<

Edit:

I created simple module:

testModule.module:

<?php


function testModule_myform($delta = "") {

    $form['something'] = array(
        '#type' => 'markup',
        '#markup' => 'Something',
    );
    return $form;
}



/**
 * Implements hook_menu();
 */

function testModule_menu() {
    $items["test/test"] = array(
        'title' => 'testModule',
        'description' => 'TODO: Description',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('testModule_myform'),
        'access callback' => TRUE,

    );
    return $items;
}

testModule.info:

name = testModule
description = Test module for Drupal experiments.
package = CustomTest
core = 7.x

testModule.install:

function testModule_update_7001() {
    drupal_set_message('It works!');
    print 'Show something!';
}

And it still ignores this hook... Is it officially a Drupal bug and I need to reinstall the whole Drupal? >_<

1
source | link

hook_update_N is not running

I know there is a question hook_update_N not running but I checked its answers and it didn't help. I'm just learning developing modules for Drupal so maybe it's something really stupid but I have no idea...

My hook (in testModule4.install):

function testModule4_update_7001() {

$schema['testModule4_table'] = array(
    'description' => 'TODO: Description',
    'fields' => array(
        'main_id' => array(
            'description' => 'TODO: Description.',
            'type' => 'serial',
            'not null' => TRUE,
        ),
        'settings' => array(
            'description' => 'TODO: Description',
            'type' => 'text',
            'not null' => FALSE,
        ),
        'uid' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
        'created' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
        'changed' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
    ),
    'primary key' => array('main_id'),
);

db_create_table('testModule4_table', $schema['testModule4_table']);

}

My module is working just fine. The schema_version of module in database is 0 but update.php just cannot see it. What can be the cause of that? :/ I was trying clearing cache and reenabling a module but without success. I just don't know where to search for source of the problem. If you need more data, just comment :/ .