Upon enabling the module for the first time on a clean Drupal installation I get the following fatal errors:

Notice: Undefined index: taxonomy_index in nodeorder_install() (line 17 of sites/all/modules/contrib/nodeorder/nodeorder.install).
Notice: Undefined index: type in DatabaseSchema_mysql->processField() (line 205 of includes/database/mysql/schema.inc).
Notice: Undefined index: :normal in DatabaseSchema_mysql->processField() (line 205 of includes/database/mysql/schema.inc).
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DEFAULT NULL, ADD INDEX `weight` (`weight`)' at line 1: ALTER TABLE {taxonomy_index} ADD `weight` DEFAULT NULL, ADD INDEX `weight` (`weight`); Array ( ) in db_add_field() (line 2844 of includes/database/database.inc).

This appears at first glance to be due to the nodeorder_schema_alter() function on line 52 of the install file not being triggered since the module is not enabled when it tries to set up the schema. It appears that simply by moving the schema definition into the nodeorder_install() function the module can be installed without the fatal error.

CommentFileSizeAuthor
#1 install_fatal_error-2316881-1.patch1005 bytesIgnigena
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ignigena’s picture

Patch attached.

Ignigena’s picture

Status: Active » Needs review

  • dieuwe committed bd59319 on 7.x-1.x
    Issue #2316881 by Ignigena: D7 fatal error on brand new installation.
    
dieuwe’s picture

I had cleaned up the install hook as it had lots of unreachable/D6 code in it, but had forgotten to test after changing the way the field definition was being fetched.

The problem line was only L17, which was

$spec = $schema['taxonomy_index']['fields']['weight'];

But should have been:

$spec = $schema['fields']['weight'];

I prefer to do it that way so not to have to repeat the field definition.

Ignigena’s picture

Thanks!

dieuwe’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.