mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Review of #2682, Also added parent deletion link on restore
On restore, added a link to the parent deletion restore if any exists on a cascading parent. Added a test to cover this case to ensure its shown. Also tweaked default empty state message on recycle bin item list to align with new column count. Also done a little existing code cleanup including a getUrl helper on the deletion items. Related to #2682 & #2594
This commit is contained in:
@ -266,10 +266,10 @@ abstract class Entity extends Model implements Sluggable, Favouritable, Viewable
|
||||
*/
|
||||
public function getParent(): ?Entity
|
||||
{
|
||||
if ($this->isA('page')) {
|
||||
if ($this instanceof Page) {
|
||||
return $this->chapter_id ? $this->chapter()->withTrashed()->first() : $this->book()->withTrashed()->first();
|
||||
}
|
||||
if ($this->isA('chapter')) {
|
||||
if ($this instanceof Chapter) {
|
||||
return $this->book()->withTrashed()->first();
|
||||
}
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user