diff --git a/docroot/sites/all/modules/contrib/rules/rules.install b/docroot/sites/all/modules/contrib/rules/rules.install index 8485df3..b98327f 100644 --- a/docroot/sites/all/modules/contrib/rules/rules.install +++ b/docroot/sites/all/modules/contrib/rules/rules.install @@ -95,13 +95,6 @@ function rules_schema() { 'length' => 255, 'not null' => FALSE, ), - 'owner' => array( - 'description' => 'The name of the module via which the rule has been configured.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => 'rules', - ), 'access_exposed' => array( 'type' => 'int', 'not null' => TRUE, @@ -125,6 +118,22 @@ function rules_schema() { 'plugin' => array('plugin'), ), ); + + // When upgrading from 2.3 to 2.9 version field Owner won't be available + // until the rules_update_7211 has run and created the field. + // @see https://www.drupal.org/node/2094879 + // We can exclude this patch when we do next version update. + $list = system_list('module_enabled'); + if ((isset($list['rules']) && ($list['rules']->schema_version == SCHEMA_UNINSTALLED || $list['rules']->schema_version >= 7211))) { + $schema['rules_config']['fields']['owner'] = array( + 'description' => 'The name of the module via which the rule has been configured.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => 'rules', + ); + } + $schema['rules_trigger'] = array( 'fields' => array( 'id' => array(