aboutsummaryrefslogtreecommitdiff
path: root/lib/models/WikiPage.class.php
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2024-04-29 14:47:17 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2024-04-29 16:48:00 +0200
commitd39f8d01d91706c41915a542925cdd77b6cf85da (patch)
tree70ff63c731c5f7709607941af43c0340504f988e /lib/models/WikiPage.class.php
parent333256118169cbdcbcb3fe7e496442ac14292f0b (diff)
Resolve "Wiki: Einzelne Wikiversionen können nicht mehr gelöscht werden"
Closes #4079 Merge request studip/studip!2925
Diffstat (limited to 'lib/models/WikiPage.class.php')
-rw-r--r--lib/models/WikiPage.class.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/models/WikiPage.class.php b/lib/models/WikiPage.class.php
index 605123e..f0df074 100644
--- a/lib/models/WikiPage.class.php
+++ b/lib/models/WikiPage.class.php
@@ -96,7 +96,7 @@ class WikiPage extends SimpleORMap implements PrivacyObject
protected function createVersion()
{
- $this->user_id = User::findCurrent()->id;
+ $last_version = $this->versions[0];
if (
!$this->isNew()
&& $this->content['content'] !== $this->content_db['content']
@@ -104,6 +104,7 @@ class WikiPage extends SimpleORMap implements PrivacyObject
$this->content_db['user_id'] !== $this->content['user_id']
|| $this->content_db['chdate'] < time() - 60 * 30
)
+ && (!$last_version || $last_version['content'] !== $this['content'])
) {
//Neue Version anlegen:
WikiVersion::create([