[dreamwidth/dreamwidth] ccd203: Convert /tools/endpoints/ljuser from BML to a TT c...
Branch: refs/heads/main Home: https://github.com/dreamwidth/dreamwidth Commit: ccd203f3941b677786bfef2d9e730e8284de8c86 https://github.com/dreamwidth/dreamwidth/commit/ccd203f3941b677786bfef2d9e730e8284de8c86 Author: Mark Smith mark@dreamwidth.org Date: 2026-06-17 (Wed, 17 Jun 2026)
Changed paths: A cgi-bin/DW/Controller/Tools/Endpoints.pm M doc/BML-MIGRATION.md M htdocs/tools/endpoints/draft.bml R htdocs/tools/endpoints/ljuser.bml
Log Message:
Convert /tools/endpoints/ljuser from BML to a TT controller (#3587)
- Convert /tools/endpoints/{ljuser,draft} from BML to a TT controller
Move the two legacy entry-editor AJAX endpoints off BML into a single DW::Controller::Tools::Endpoints, registered as JSON routes (format => 'json', so the dispatcher sets application/json and the handlers print via DW::RPC). URLs, request params, userprops, and response shapes are unchanged, so the existing JS callers (entry.js, rte.js) keep working. Neither page had a .text file, so there are no strings to migrate.
Run-on: Niteshift
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- Revert the /tools/endpoints/draft migration; keep only ljuser
draft is only called by js/entry.js, which is loaded solely by the deprecated legacy editor (update.bml / editjournal.bml edit form). The new editor already has its own equivalent at /rpcdraft (DW::Controller::Entry::draftrpc_handler), so /tools/endpoints/draft is legacy-only plumbing that will be removed with that editor — migrating it just added a third copy. Restore draft.bml as BML.
ljuser stays migrated: it is still called by the live new editor (views/entry/form.tt -> js/pages/entry/rte.js) and has no replacement.
Run-on: Niteshift
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- Add a DEPRECATED note to draft.bml warning against migration
Documents that /tools/endpoints/draft is legacy-editor-only and already has a modern replacement at /_rpcdraft, so it should be deleted with the legacy editor rather than ported to TT.
Run-on: Niteshift
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- Harden BML-MIGRATION §0 with a disposition gate and the "already replaced" check
Make §0 an explicit pre-code gate (write a migrate/deprecate/leave/delete disposition with grep evidence first), add a dedicated check for the trap where the modern flow has already reimplemented the endpoint under a new name (e.g. /tools/endpoints/draft vs /_rpcdraft), and note that a left-to-die file should still get a deprecation note.
Run-on: Niteshift
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
