Compare commits

..

1 Commits

Author SHA1 Message Date
Théo Zehnder
a81d59029d Fix: New revision is created but no changes were made #6062 2026-03-19 14:49:14 +01:00
11 changed files with 19 additions and 147 deletions

6
.gitignore vendored
View File

@@ -8,10 +8,10 @@ Homestead.yaml
.idea
npm-debug.log
yarn-error.log
/public/dist/*.map
/public/dist
/public/plugins
/public/css/*.map
/public/js/*.map
/public/css
/public/js
/public/bower
/public/build/
/public/favicon.ico

View File

@@ -118,27 +118,29 @@ class PageRepo
*/
public function update(Page $page, array $input): Page
{
// Hold the old details to compare later
// Hold the old details to compare later.
$oldName = $page->name;
$oldHtml = $page->html;
$oldMarkdown = $page->markdown;
$this->updateTemplateStatusAndContentFromInput($page, $input);
$page = $this->baseRepo->update($page, $input);
// Update with new details
$page->revision_count++;
$page->save();
// Remove all update drafts for this user and page.
$this->revisionRepo->deleteDraftsForCurrentUser($page);
// Save a revision after updating
// Values used to determine if a change has been made.
$summary = trim($input['summary'] ?? '');
$htmlChanged = isset($input['html']) && $input['html'] !== $oldHtml;
$htmlChanged = isset($page->html) && $page->html !== $oldHtml;
$nameChanged = isset($input['name']) && $input['name'] !== $oldName;
$markdownChanged = isset($input['markdown']) && $input['markdown'] !== $oldMarkdown;
$markdownChanged = isset($page->markdown) && $page->markdown !== $oldMarkdown;
// Update with new details, only if the page really changed.
if ($htmlChanged || $nameChanged || $markdownChanged || $summary) {
$page = $this->baseRepo->update($page, $input);
$page->revision_count++;
$page->save();
// Remove all update drafts for this user and page.
$this->revisionRepo->deleteDraftsForCurrentUser($page);
$this->revisionRepo->storeNewForPage($page, $summary);
}

View File

@@ -1 +1 @@
df9854136249aa316fa799eacb046eb3c14a6248fe5f3038ab7f500e83e83866
22e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1

33
public/dist/app.js vendored

File diff suppressed because one or more lines are too long

32
public/dist/code.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
v26.03.1
v26.01-dev