We have a Module defining uuid_features and while as dependencies. When we enable that module we get a fatal error.
If we enable the modules one after another, everything works fine.

exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uuid' in 'where clause'' in [error]
/var/www/bi/learnattack/src/includes/database/database.inc:2171
Stack trace:
#0 /var/www/bi/learnattack/src/includes/database/database.inc(2171): PDOStatement->execute(Array)
#1 /var/www/bi/learnattack/src/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array)
#2 /var/www/bi/learnattack/src/includes/database/select.inc(1265): DatabaseConnection->query('SELECT t.id AS ...', Array, Array)
#3 /var/www/bi/learnattack/src/sites/all/modules/contrib/uuid/uuid.module(176): SelectQuery->execute()
#4 /var/www/bi/learnattack/src/sites/all/modules/contrib/uuid/uuid.module(160): _uuid_sync_table('while_base', 'id', 'uuid')
#5 [internal function]: uuid_uuid_sync()
#6 /var/www/bi/learnattack/src/includes/module.inc(895): call_user_func_array('uuid_uuid_sync', Array)
#7 /var/www/bi/learnattack/src/sites/all/modules/contrib/uuid/uuid.inc(44): module_invoke_all('uuid_sync')
#8 /var/www/bi/learnattack/src/sites/all/modules/contrib/uuid/uuid.install(49): uuid_sync_all()
#9 [internal function]: uuid_install()
#10 /var/www/bi/learnattack/src/includes/module.inc(866): call_user_func_array('uuid_install', Array)
#11 /var/www/bi/learnattack/src/includes/module.inc(477): module_invoke('uuid', 'install')
#12 /opt/drush7/vendor/drush/drush/commands/core/drupal/environment_7.inc(143): module_enable(Array)
#13 /opt/drush7/vendor/drush/drush/commands/pm/pm.drush.inc(1120): drush_module_enable(Array)
#14 [internal function]: drush_pm_enable('learnattack_fea...')
#15 /opt/drush7/vendor/drush/drush/includes/command.inc(359): call_user_func_array('drush_pm_enable', Array)
#16 /opt/drush7/vendor/drush/drush/includes/command.inc(210): _drush_invoke_hooks(Array, Array)
#17 [internal function]: drush_command('learnattack_fea...')
#18 /opt/drush7/vendor/drush/drush/includes/command.inc(178): call_user_func_array('drush_command', Array)
#19 /opt/drush7/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php(46): drush_dispatch(Array)
#20 /opt/drush7/vendor/drush/drush/drush.php(76): Drush\Boot\DrupalBoot->bootstrap_and_dispatch()
#21 /opt/drush7/vendor/drush/drush/drush.php(16): drush_main()
#22 {main}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zuernBernhard’s picture

FileSize
873 bytes

If we make sure that the dependency for while comes AFTER the dependency of uuid we can make it work with the following patch.

fago’s picture

I don't think we can ensure the order? But yeah, I remember that we ran into that issue once as well. Not sure how to fix it, but your patch seems to makes things more stable at least?

zuernBernhard’s picture

Hm,

in my opinion it's more a hack than a solution. Webflo helped me on that. It works now for us but it is far from "beautiful" ... ;)

a.milkovsky’s picture

Status: Active » Needs review
FileSize
515 bytes

I have also got a similar issue. What do you think about checking table during the installation?
The problem is in while_schema_alter() function. It is executed during schema creation, when 'while_type' table doesn't already exist.
See my patch

The error:

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uuid' in 'where clause': SELECT t.id AS id                                                                                  [error]
FROM 
{while_base} t
WHERE ( (uuid = :db_condition_placeholder_0) OR (uuid IS NULL ) ); Array
(
    [:db_condition_placeholder_0] => 
)
 in _uuid_sync_table() (line 176 of /home/milkovsky/projects/d7/vcs/sites/all/modules/contrib/uuid/uuid.module).
Cannot modify header information - headers already sent by (output started at /home/milkovsky/.composer/vendor/drush/drush/includes/output.inc:38) bootstrap.inc:1233                                     [warning]
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uuid' in 'where clause': SELECT t.id AS id
FROM 
{while_base} t
WHERE ( (uuid = :db_condition_placeholder_0) OR (uuid IS NULL ) ); Array
(
    [:db_condition_placeholder_0] => 
)
 in _uuid_sync_table() (line 176 of /home/milkovsky/projects/d7/vcs/sites/all/modules/contrib/uuid/uuid.module).
Drush command terminated abnormally due to an unrecoverable error.