Unverified Commit 06d7aaad authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3557465 by phenaproxima, thejimbirch, alexpott: The default content...

Issue #3557465 by phenaproxima, thejimbirch, alexpott: The default content exporter should ignore `created` fields

(cherry picked from commit 2b63f874)
parent 13d4f6c1
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -69,10 +69,12 @@ public function export(ContentEntityInterface $entity): ExportResult {
    $event->setEntityKeyExportable('revision_default', FALSE);
    $event->setEntityKeyExportable('revision_created', FALSE);

    // Default content has no history, so it doesn't make much sense to export
    // `changed` fields.
    // Ignore fields that don't make sense in default content:
    // - `changed` fields aren't needed because default content has no history.
    // - `created` fields aren't needed because default content should be
    //   "created" upon import.
    foreach ($field_definitions as $name => $definition) {
      if ($definition->getType() === 'changed') {
      if (in_array($definition->getType(), ['changed', 'created'], TRUE)) {
        $event->setExportable($name, FALSE);
      }
    }
+0 −3
Original line number Diff line number Diff line
@@ -22,6 +22,3 @@ default:
  status:
    -
      value: true
  created:
    -
      value: 1711121742
+0 −3
Original line number Diff line number Diff line
@@ -22,6 +22,3 @@ default:
  status:
    -
      value: true
  created:
    -
      value: 1711121742
+0 −3
Original line number Diff line number Diff line
@@ -24,6 +24,3 @@ default:
  status:
    -
      value: true
  created:
    -
      value: 1711729897
+0 −3
Original line number Diff line number Diff line
@@ -22,6 +22,3 @@ default:
  status:
    -
      value: true
  created:
    -
      value: 1711121742
Loading