Hi there!

In postgresql on the lastest 3.4 release I am getting an error while running drush updatedb.

I am not really sure why I have a null entry in the pid column but this is the first time a hook_upate_n has failed for me with panelizer.

Performed update: panels_update_7304                                                                                                                                                             [ok]
Performed update: panels_update_7305                                                                                                                                                             [ok]
Performed update: panels_mini_update_7301                                                                                                                                                     [ok]
Performed update: panels_update_7306                                                                                                                                                             [ok]
Performed update: panelizer_update_7118                                                                                                                                                         [ok]
Performed update: panelizer_update_7119                                                                                                                                                         [ok]
SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "pid" violates not-null constraint                                                                                           [error]
DETAIL:  Failing row contains (null, 713, pearson_first, page_title, page_title, 1, a:0:{}, a:5:{s:6:"markup";s:2:"h1";s:5:"class";s:0:"";s:2:"id";s:7:"wb-c..., a:0:{}, a:1:{s:8:"settings";N;},
a:0:{}, a:0:{}, 0, a:0:{}, 1a7cd846-433f-4901-9f4c-1ecef43cad4c).
Performed update: panelizer_update_7120
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sylus created an issue. See original summary.

sylus’s picture

Issue summary: View changes
DamienMcKenna’s picture

Issue tags: +PostgreSQL
Related issues: +#2785923: Fix PostgreSQL compatibility
DamienMcKenna’s picture

Title: Panelizer 3.4 update + Not null violation: 7 ERROR: null value in column "pid" violates not-null » panelizer_update_7120: Not null violation: 7 ERROR: null value in column "pid" violates not-null

It seems like this is caused by panelizer_update_7120().

sylus’s picture

Priority: Normal » Major

I am just going to update the severity as it prevents me updating to latest security release fixes.

sylus’s picture

Well I think I got passed that hook_update_n issue though not sure if is correct. ^_^

I did see similar code to what I have done earlier and the pid column in panels_schema does state:

    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'not null' => TRUE,
      ),

Here is my current run through now with the patch it does seem to have recovered some panes though now running into a larger issue with panelizer_update_7300 that fatals my site so probably not a good patch.

Panelizer  7120  Update 7115 may have resulted in {panels_pane} records not being created  properly. This will create them, and may take some time.
Panelizer  7121  Fix the 'selection' variables.
Panelizer  7300  Remove {panelizer_entity} records with only default values.
Panelizer  7301  Add an index to {panelizer_entity} revision IDs.
Panelizer  7302  Set the storage type and ID on existing {panelizer_default} records.
Panelizer  7303  Set the storage type and ID on existing {panelizer_entity} records. This may  take some time to complete.
Recovered panes for 4 entities out of 4 total.                                                                                                                                                                                                                              [ok]
Performed update: panelizer_update_7120                                                                                                                                                                                                                                     [ok]
Performed update: panelizer_update_7121                                                                                                                                                                                                                                     [ok]
SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near ")"                                                                                                                                                                                                     [error]
LINE 2: WHERE  (name IN  ()) AND (entity_type = 'node')
                         ^
Performed update: panelizer_update_7300
sylus’s picture

Status: Active » Needs review
FileSize
2.09 KB

Ok the second issue was there was no $default_names to delete as the following logic never got entered because there were no view_modes. Perhaps because I am using beans and related to https://www.drupal.org/node/2776173 but nonetheless the code below never get entered:

if (!empty($settings) && !empty($settings['view modes'])) {
  foreach ($settings['view modes'] as $view_mode => $config) {
    $default_name = implode(':', array($entity_type, $bundle, 'default'));
    if ($view_mode != 'page_manager') {
      $default_name .= ':' . $view_mode;
     }
     $default_names[] = $default_name;
  }
}

I think there should be logic encapsulating the db_delete logic in hook_update_7300 so added that in the most recent patch. I now get the following when running drush updatedb. ^_^

Performed update: panels_update_7304                                                                                                                                                                                                                                        [ok]
Performed update: panels_update_7305                                                                                                                                                                                                                                        [ok]
Added the storage type for panels_mini to relevant panels displays                                                                                                                                                                                                          [ok]
Performed update: panels_mini_update_7301                                                                                                                                                                                                                                   [ok]
Performed update: panels_update_7306                                                                                                                                                                                                                                        [ok]
Performed update: panelizer_update_7118                                                                                                                                                                                                                                     [ok]
Fixed {panelizer_entity} records for 50 entities out of 50 total.                                                                                                                                                                                                           [ok]
Performed update: panelizer_update_7119                                                                                                                                                                                                                                     [ok]
Recovered panes for 4 entities out of 4 total.                                                                                                                                                                                                                              [ok]
Performed update: panelizer_update_7120                                                                                                                                                                                                                                     [ok]
Performed update: panelizer_update_7121                                                                                                                                                                                                                                     [ok]
Added an extra index on the {panelizer_entity} table for the revision_id column.                                                                                                                                                                                            [ok]
Performed update: panelizer_update_7301                                                                                                                                                                                                                                     [ok]
Added the storage type for panelizer_defaults to relevant panels displays                                                                                                                                                                                                   [ok]
Performed update: panelizer_update_7302                                                                                                                                                                                                                                     [ok]
User agent already up to date.                                                                                                                                                                                                                                              [ok]
Performed update: linkchecker_update_7012                                                                                                                                                                                                                                   [ok]
Added the storage type for panelizer_entities to relevant panels displays                                                                                                                                                                                                   [ok]
Performed update: panelizer_update_7303                                                                                                                                                                                                                                     [ok]
Added the storage type for panelizer_entities to relevant panels displays                                                                                                                                                                                                   [ok]
Performed update: panelizer_update_7303                                                                                                                                                                                                                                     [ok]
Added the storage type for panelizer_entities to relevant panels displays                                                                                                                                                                                                   [ok]
Performed update: panelizer_update_7303                                                                                                                                                                                                                                     [ok]
Added the storage type for panelizer_entities to relevant panels displays                                                                                                                                                                                                   [ok]
Performed update: panelizer_update_7303                                                                                                                                                                                                                                     [ok]
sylus’s picture

Priority: Major » Normal

Just lowering priority since patch allows me to complete update process ^_^

  • DamienMcKenna committed 1df0d5f on 7.x-3.x authored by sylus
    Issue #2788633 by sylus: Fixes to panelizer_update_7120() and...
DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #2787147: Plan for Panelizer 7.x-3.5 release

Thanks for the patches! Committed.

Status: Fixed » Closed (fixed)

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