Unverified Commit 89d02822 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2784783 by RytoEX, quietone, jofitz, Charlotte17, Anybody,...

Issue #2784783 by RytoEX, quietone, jofitz, Charlotte17, Anybody, tomhollevoet, catch, Grevil: Migration of nodes with cck nodereferrer fields fails (SQL error)

(cherry picked from commit 81174ad7)
parent ed5f0fba
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -297,6 +297,10 @@ protected function getFieldData(array $field, Row $node) {

    if (isset($query)) {
      $columns = array_keys($field['db_columns']);
      // If there are no columns then there are no values to return.
      if (empty($columns)) {
        return [];
      }

      // Add every column in the field's schema.
      foreach ($columns as $column) {
+24 −0
Original line number Diff line number Diff line
@@ -38,6 +38,18 @@ public function providerSource() {
        'active' => '1',
        'locked' => '0',
      ],
      [
        'field_name' => 'field_test_empty_db_columns',
        'type' => 'empty_db_columns',
        'global_settings' => 'a:0:{}',
        'required' => '0',
        'multiple' => '0',
        'db_storage' => '1',
        'module' => 'empty_db_columns',
        'db_columns' => 'a:0:{}',
        'active' => '1',
        'locked' => '0',
      ],
    ];
    $tests[0]['source_data']['content_node_field_instance'] = [
      [
@@ -52,6 +64,18 @@ public function providerSource() {
        'widget_module' => 'number',
        'widget_active' => '1',
      ],
      [
        'field_name' => 'field_test_empty_db_columns',
        'type_name' => 'story',
        'weight' => '33',
        'label' => 'Empty db_columns Field',
        'widget_type' => 'empty_db_columns',
        'widget_settings' => 'a:0:{}',
        'display_settings' => 'a:0:{}',
        'description' => 'An example field with empty db_columns.',
        'widget_module' => 'empty_db_columns',
        'widget_active' => '1',
      ],
    ];
    $tests[0]['source_data']['content_type_story'] = [
      [