openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 157810411325695ef00f5a2c33f404f5676cf3b4
parent fd31f72927e128b89325e9e2885f3948711777cf
Author: dankert <openrat@jandankert.de>
Date:   Mon,  6 Dec 2021 02:11:33 +0100

New: Do not store value is nothing has changed.

Diffstat:
Mmodules/cms/action/page/PageAllAction.class.php | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/modules/cms/action/page/PageAllAction.class.php b/modules/cms/action/page/PageAllAction.class.php @@ -209,6 +209,8 @@ class PageAllAction extends PageAction implements Method { $value = new Value(); $value->contentid = $pageContent->contentId; + $oldValue = clone $value; + $oldValue->load(); switch ($element->typeid) { @@ -250,6 +252,15 @@ class PageAllAction extends PageAction implements Method { if ($lastChangeTime) $this->addWarningFor($value, Messages::CONCURRENT_VALUE_CHANGE, array('last_change_time' => date(L::lang('DATE_FORMAT'), $lastChangeTime))); + // Check if anything has changed + if ( $oldValue->publish == $value->publish && + $oldValue->text == $value->text && + $oldValue->linkToObjectId == $value->linkToObjectId && + $oldValue->format == $value->format && + $oldValue->number == $value->number && + $oldValue->date == $value->date ) + continue; // nothing has changed. + // Inhalt speichern $value->persist();