fix: Restore button now sends you to Active tab where the note lives (v3.4.1)
After v3.4.0 introduced the Active/Completed tab strip, clicking Restore on a completed note appeared to do nothing — the restored note never showed up. David: "the complete log does not return to active." Root cause: the Restore handler in wp_notes_page_callback() was the only action handler without a wp_redirect() + exit; after its update_option() calls. Every other handler (new note, mark-as-done single, mark-as-done bulk) had one. So Restore relied on the page falling through and re-rendering, which used to work when both Active and Completed sections rendered on the same page (user could glance up to see the restored note in the Active section). v3.4.0's single-pane tab render exposed the latent bug: after Restore, the URL still says ?tab=completed, so only Completed re-renders (minus the now-restored note), and the restored note is invisible on Active. Fix: add the missing redirect to admin.php?page=wp-notes (defaults to Active tab) after the restore completes. The restored note now appears in its new home immediately. Patch bump — bug fix only, no API or behavioural changes beyond the fix itself. Other handlers, storage model, tab structure, and CSS are unchanged.
This commit is contained in:
@@ -9,6 +9,28 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi
|
||||
|
||||
---
|
||||
|
||||
## [3.4.1] — 2026-05-27
|
||||
|
||||
### Fixed — Restore button now sends you to the Active tab where the restored note lives
|
||||
|
||||
After v3.4.0 introduced the Active/Completed tab strip, clicking **Restore** on a completed note appeared to "do something" but the restored note never showed up. David reported it as *"the complete log does not return to active."*
|
||||
|
||||
Root cause: the Restore action handler in `wp_notes_page_callback()` (line ~1340) was the **only** action handler in the file without a `wp_redirect() + exit;` after its `update_option()` calls — every other handler (new note, mark-as-done single, mark-as-done bulk) had one. So Restore was relying on the page falling through and re-rendering, which used to work when both Active and Completed sections rendered on the same page (the user could just glance up to see the restored note in the Active section). v3.4.0's single-pane tab render exposed the latent bug: after Restore, the URL still said `?tab=completed`, so only Completed re-rendered (minus the now-restored note), and the restored note was invisible on Active.
|
||||
|
||||
Fix: add the missing redirect to `admin.php?page=wp-notes` (which defaults to the Active tab) after the restore completes. The restored note now appears in its new home immediately.
|
||||
|
||||
### Files changed
|
||||
|
||||
- `wp-notes.php` — `wp_notes_page_callback()` Restore handler: added `wp_redirect(admin_url('admin.php?page=wp-notes')); exit;` after the two `update_option()` calls. Five-line change plus a load-bearing comment explaining the bug history so future-Claude doesn't reintroduce it.
|
||||
- Plugin header `Version: 3.4.0 → 3.4.1`; `WP_NOTES_VERSION` constant updated to match. PATCH bump (bug fix, no API or behavioural changes beyond the fix itself).
|
||||
|
||||
### Not changed
|
||||
|
||||
- The other three action handlers (new note, mark-as-done) — they already had correct redirects; no need to touch.
|
||||
- Storage model, tab structure, CSS — all unchanged from v3.4.0.
|
||||
|
||||
---
|
||||
|
||||
## [3.4.0] — 2026-05-27
|
||||
|
||||
### Added — Active / Completed tabs on the My Log page
|
||||
|
||||
Reference in New Issue
Block a user