Skip to content

Commit

Permalink
CON-2619 fixed check for prevention of creating too much versions by …
Browse files Browse the repository at this point in the history
…saving same content
  • Loading branch information
4fb committed Jan 10, 2017
1 parent 797f9e4 commit e4deec9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contenido/classes/versioning/class.contentversioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,13 @@ public function prepareContentForSaving($idartlang, cApiContent $content, $value
// times. Therefore its necessary to check if the same change already
// has been saved and prevent multiple savings.
static $savedTypes = array();
if (isset($savedTypes[$content->get('idtype') . $content->get('typeid')])) {

$contentTypeIdent = $content->get('idartlang') . $content->get('idtype') . $content->get('typeid');

if (isset($savedTypes[$contentTypeIdent])) {
return;
}
$savedTypes[$content->get('idtype').$content->get('typeid')] = $value;
$savedTypes[$contentTypeIdent] = $value;

$versioningState = $this->getState();
$date = date('Y-m-d H:i:s');
Expand Down

0 comments on commit e4deec9

Please sign in to comment.