File tree Expand file tree Collapse file tree 5 files changed +8
-11
lines changed Expand file tree Collapse file tree 5 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,7 @@ protected function prepareTable($table)
347347 // Set the values
348348 $ table ->created = $ date ->toSql ();
349349 $ table ->created_by = $ user ->id ;
350+ $ table ->version = 1 ;
350351
351352 // Set ordering to the last item if not set
352353 if (empty ($ table ->ordering )) {
@@ -364,10 +365,8 @@ protected function prepareTable($table)
364365 // Set the values
365366 $ table ->modified = $ date ->toSql ();
366367 $ table ->modified_by = $ user ->id ;
368+ $ table ->version ++;
367369 }
368-
369- // Increment the content version number.
370- $ table ->version ++;
371370 }
372371
373372 /**
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ protected function prepareTable($table)
363363 if (empty ($ table ->id )) {
364364 // Set the values
365365 $ table ->created = $ date ;
366+ $ table ->version = 1 ;
366367
367368 // Set ordering to the last item if not set
368369 if (empty ($ table ->ordering )) {
@@ -379,10 +380,8 @@ protected function prepareTable($table)
379380 // Set the values
380381 $ table ->modified = $ date ;
381382 $ table ->modified_by = $ this ->getCurrentUser ()->id ;
383+ $ table ->version ++;
382384 }
383-
384- // Increment the content version number.
385- $ table ->version ++;
386385 }
387386
388387 /**
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ protected function prepareTable($table)
347347 }
348348
349349 // Increment the content version number.
350- $ table ->version ++ ;
350+ $ table ->version = empty ( $ table -> version ) ? 1 : $ table -> version + 1 ;
351351
352352 // Reorder the articles within the category so the new article is first
353353 if (empty ($ table ->id )) {
Original file line number Diff line number Diff line change @@ -305,6 +305,7 @@ protected function prepareTable($table)
305305 if (empty ($ table ->id )) {
306306 // Set the values
307307 $ table ->created = $ date ->toSql ();
308+ $ table ->version = 1 ;
308309
309310 // Set ordering to the last item if not set
310311 if (empty ($ table ->ordering )) {
@@ -321,10 +322,8 @@ protected function prepareTable($table)
321322 // Set the values
322323 $ table ->modified = $ date ->toSql ();
323324 $ table ->modified_by = $ user ->id ;
325+ $ table ->version ++;
324326 }
325-
326- // Increment the content version number.
327- $ table ->version ++;
328327 }
329328
330329 /**
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ public function save($data)
325325 protected function prepareTable ($ table )
326326 {
327327 // Increment the content version number.
328- $ table ->version ++ ;
328+ $ table ->version = empty ( $ table -> version ) ? 1 : $ table -> version + 1 ;
329329 }
330330
331331 /**
You can’t perform that action at this time.
0 commit comments