Skip to content

NOW MANAGED ON CODEBERG

Fixed error on webhooks for recycle bin operations

Dan Brown4239d4c54d3d
diff --git a/app/Entities/Models/Deletion.php b/app/Entities/Models/Deletion.php
index 97abb87ff..181c9c580 100644
--- a/app/Entities/Models/Deletion.php
+++ b/app/Entities/Models/Deletion.php
@@ -59,7 +59,7 @@ class Deletion extends Model implements Loggable
/**
* Get a URL for this specific deletion.
*/
- public function getUrl($path): string
+ public function getUrl(string $path = 'restore'): string
{
return url("/settings/recycle-bin/{$this->id}/" . ltrim($path, '/'));
}
diff --git a/app/Entities/Models/PageRevision.php b/app/Entities/Models/PageRevision.php
index 2bfa169f4..4daf50536 100644
--- a/app/Entities/Models/PageRevision.php
+++ b/app/Entities/Models/PageRevision.php
@@ -46,19 +46,10 @@ class PageRevision extends Model
/**
* Get the url for this revision.
- *
- * @param null|string $path
- *
- * @return string
*/
- public function getUrl($path = null)
+ public function getUrl(string $path = ''): string
{
- $url = $this->page->getUrl() . '/revisions/' . $this->id;
- if ($path) {
- return $url . '/' . trim($path, '/');
- }
-
- return $url;
+ return $this->page->getUrl('/revisions/' . $this->id . '/' . ltrim($path, '/'));
}
/**