1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added test & update to prevent page creation w/ empty slug

Caused by changes to page repo in reference work,
This adds back in the slug generate although at a more central place.
Adds a test case to cover the problematic scenario.
This commit is contained in:
Dan Brown
2022-09-01 12:53:34 +01:00
parent f092c97748
commit 34c63e1c30
2 changed files with 29 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class BaseRepo
$entity->fill($input);
$entity->updated_by = user()->id;
if ($entity->isDirty('name')) {
if ($entity->isDirty('name') || empty($entity->slug)) {
$entity->refreshSlug();
}