In entity specification in file Box.php are missing revision_medata_keys and in method preSaveRevision is used incorrect field name (revision_log instead of revision_log_message).

CommentFileSizeAuthor
#9 3092638-9.patch1.06 KBhavran
#2 3092638-2-fix.patch1.55 KBhavran

Comments

havran created an issue. See original summary.

havran’s picture

StatusFileSize
new1.55 KB

Patch included.

havran’s picture

Issue summary: View changes
pasqualle’s picture

  • Pasqualle committed 1dd470f on 8.x-2.x authored by havran
    Issue #3092638 by havran: Add missing revision_medata_keys, fix...

Status: Fixed » Closed (fixed)

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

havran’s picture

Please, reopen this because there one ore problem with revision_log.

DIFF for review (i provide patch later):

vagrant@d8:/data/uniweb/uniweb-cms/4.x/web/modules/contrib/box[(1dd470f...) *]$ git diff
diff --git a/src/Entity/Box.php b/src/Entity/Box.php
index 08f4fa1..92d9d1d 100644
--- a/src/Entity/Box.php
+++ b/src/Entity/Box.php
@@ -139,12 +139,12 @@ class Box extends EditorialContentEntityBase implements BoxInterface {
   public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) {
     parent::preSaveRevision($storage, $record);

-    if (!$this->isNewRevision() && isset($this->original) && (!isset($record->revision_log_message) || $record->revision_log_message === '')) {
+    if (!$this->isNewRevision() && isset($this->original) && (!isset($record->revision_log) || $record->revision_log === '')) {
       // If we are updating an existing box without adding a new revision, we
       // need to make sure $entity->revision_log is reset whenever it is empty.
       // Therefore, this code allows us to avoid clobbering an existing log
       // entry with an empty one.
-      $record->revision_log_message = $this->original->revision_log_message->value;
+      $record->revision_log = $this->original->getRevisionLogMessage();
     }
   }
pasqualle’s picture

Status: Closed (fixed) » Active
havran’s picture

StatusFileSize
new1.06 KB

If you create box translation and you want delete it, then you get similar error. Patch with fix attached.

  • Pasqualle committed a2069a4 on 8.x-2.x authored by havran
    Issue #3092638 by havran, Pasqualle: Add missing revision_medata_keys,...
pasqualle’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Issue tags: -revisions