Commit 4850140c authored by Brent Gees's avatar Brent Gees Committed by Oleksandr Kuzava
Browse files

Issue #3273454: Field path is unknown when path is not installed

parent eb8bd105
Loading
Loading
Loading
Loading
+1 −1
Changes for src/ContentExporter.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ class ContentExporter implements ContentExporterInterface {
            'created' => $entity->getCreatedTime(),
            'changed' => $entity->getChangedTime(),
            'author' => $owner ? $owner->getEmail() : NULL,
            'url' => $entity->get('path')->alias ?? NULL,
            'url' => $entity->hasField('path') ? $entity->get('path')->alias : NULL
          ];
        }
        break;
+7 −3
Changes for src/ContentImporter.php: 7 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -363,17 +363,21 @@ class ContentImporter implements ContentImporterInterface {

    switch ($entity_type_id) {
      case 'node':
        return [
        $node = [
          'title' => $values['title'],
          'langcode' => $values['langcode'],
          'created' => $values['created'],
          'changed' => $values['changed'],
          'status' => $values['status'],
          'path' => [
        ];
        // We check if node url alias is filled in.
        if (isset($values['url'])) {
          $node = [
            'alias' => $values['url'],
            'pathauto' => empty($values['url']),
          ],
          ];
        }
        return $node;

      case 'user':
        return [