Update docs to reflect date+time+title slug format
- qa-test-plan: update expected folder, URL, and automation greps in TC-P.5, TC-P.6, TC-P.7; add slug explanation block to test data; rewrite TC-P.10 to cover two posts on the same day (now valid) - bugs-and-fixes: add BUG-003 documenting the silent duplicate-date failure and the slug fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+33
-1
@@ -33,7 +33,7 @@ Wire cache-clear into the form process so it happens automatically on every succ
|
||||
|
||||
1. Create a small plugin `user/plugins/cache-on-save/` with one event listener:
|
||||
- Listen on `onFormProcessed`
|
||||
- When the form name is `new-entry`, call `$this->grav['cache']->clear()`
|
||||
- When the form name is `new-entry`, call `$this->grav['cache']->deleteAll()` (note: `clear()` does not exist on `Grav\Common\Cache` in Grav 1.7)
|
||||
2. Enable the plugin in `user/config/plugins/cache-on-save.yaml`
|
||||
|
||||
This is the cleanest approach: it fires exactly once per successful submission, requires no changes to `post-form.md`, and works for any future forms too.
|
||||
@@ -102,3 +102,35 @@ Acceptable for a single-user dev setup — eliminates both BUG-001's side-effect
|
||||
2. Reload any page — no 500 error, template works immediately without manual cache flush
|
||||
|
||||
---
|
||||
|
||||
## BUG-003 — One post per day limit; silent failure on duplicate date
|
||||
|
||||
**Status:** fixed 2026-06-18
|
||||
**Reported:** 2026-06-18
|
||||
|
||||
### Symptom
|
||||
|
||||
Submitting a second post with the same date as an existing entry shows "Entry posted successfully!" but creates no file. The user's post is silently discarded.
|
||||
|
||||
### Root cause
|
||||
|
||||
The `add-page-by-form` plugin built the page slug from date only (`Y-m-d`), producing folder names like `2026-06-18.entry`. With `overwrite_mode: false`, if that folder already exists the plugin skips page creation but does not abort — the `message` process step runs regardless, showing a false success.
|
||||
|
||||
### Fix
|
||||
|
||||
Change the slug template in `user/pages/02.post/post-form.md` to include time and title:
|
||||
|
||||
```twig
|
||||
{{ form.value.date|date('Y-m-d-Hi') }}-{{ form.value.title|lower|regex_replace('/[^a-z0-9]+/', '-')|trim('-') }}
|
||||
```
|
||||
|
||||
Example: title "Arrived in Tokyo" at 14:30 on 2026-06-18 → `2026-06-18-1430-arrived-in-tokyo`
|
||||
|
||||
The slug is locked at creation time. Renaming the title afterwards does not change the URL.
|
||||
|
||||
### Acceptance criteria
|
||||
|
||||
1. Submit two posts on the same day with different times or titles — both appear in `/tracker` as separate entries
|
||||
2. Renaming a post's title in the frontmatter does not break its URL
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user