[6.x] Singles as sources - #19552
Draft
brianjhanson wants to merge 6 commits into
Draft
Conversation
craftcms/cms is the root package here, not a discovered dependency, so package discovery never registers the aliases declared in composer.json. Without them the Twig globals that CP templates reach for (DeltaRegistry, Sites, Fields, …) don't exist, and _layouts/cp fails to render. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
SQLite has no DROP CONSTRAINT, so Laravel rebuilds the table and matches the foreign key by column rather than by name. Passing only the name left the command's columns empty, which threw. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
Singles shared one aggregate `singles` source, so they couldn't be placed
in the control panel navigation, given their own index page, or told apart
in a breadcrumb. Each Single section now emits a `section:{uid}` source of
its own, grouped under a “Singles” heading like the other section types,
and keeps the sort and columns that suited the old aggregate.
`content/{page}/singles` still resolves, as a criteria-only pseudo-source
spanning every editable Single, so bookmarks keep working. A migration
rewrites a stored `singles` row into one row per Single in place, keeping
each site's ordering, page assignments and display settings.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
Element types define their group headings without keys, as did headings
stored before the modal started keying them. The modal can't build a Form
for a keyless row or post it back in `sourceOrder`, so the first save of a
source list dropped every heading it hadn't created itself — the legacy
modal keyed them client-side, which the Vue one no longer did.
A labeled heading now gets the same `heading:{uuid}` key on its way out.
The blank heading ElementSources synthesizes as a separator is regenerated
on every read, so it stays keyless and unsaveable.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
A source could only get a page of its own by making the page first and then moving the source onto it from a menu. Dragging it into the pages sidebar now does both, dropping it in as a page beside the ones it lands between. Each list of rows kept its drags to itself, so `useDragAndDrop` grew an opt-in for the other list: `dragData` says what a row carries, and a list that accepts it reports where it landed through `onForeignDrop` instead of reordering. Lists that don't opt in behave exactly as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
A page whose only source is a Single had a nav item pointing at an index listing the one entry you were going to open anyway. It now points at the entry, and stays selected while you're editing it. Every other page — one holding more than the single, or one whose single has no entry yet — keeps its index. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
|
Yay! 🙂 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the ability to put a single up into the "Pages" section of your navigation.
Related issues