Minor Changes
-
#3294
f6d7c7aThanks @ascorbic! - Fixesemdash export-seedoutput so it survivesemdash seedon a fresh database, and adds--media-base-urlso exported media can be imported.- Exports sections and redirect rules. Anything a seed cannot represent is left out with a warning on stderr: redirect rules with status 410 or 451, duplicate redirect sources kept from older databases, and imported sections whose slug contains characters other than lowercase letters, digits, and hyphens.
- Menu items that link to exported content now point at the restored entries instead of losing their link.
emdash seedalso restores links to entries in custom collections and collection archive links. - Scheduled entries are exported as drafts instead of being published on import.
- Exports each collection's comments setting and its title and date fields, and whether each field is translatable. Seed fields accept
translatable, and sections acceptsource: "user". - Exports file fields and image sub-fields of repeaters as
$mediareferences, as well as image fields.
$mediaURLs are site-relative by default, andemdash seedcannot download a relative URL, so those fields came back empty. Pass the source site's public URL to write absolute URLs:npx emdash export-seed --with-content=all --media-base-url=https://example.com > seed.jsonWithout
--media-base-url, the export warns when it writes relative media URLs. Images inside Portable Text fields are not converted and still refer to the source site's media. -
#1928
a5b4504Thanks @MA2153! - Adds relations, and makesreferencefields entry pickers that link through them. A relation joins two collections under a site-unique slug, with a label and an optional link limit for each side; a reference field shows one side of it. An entry's selection is shared by all its translations, and on collections with revisions it goes live when the entry is published. Send selections underreferenceson entry create and update, keyed by field slug. To render them, pass the field slugs in thereferencesoption ofgetEmDashEntry, and usegetEmDashReferencesto page past the first 50.emdash typesgenerates a{Collection}Referencesinterface, seeds accept a top-levelrelationsarray, andemdash export-seed --with-contentexports each entry's links. See the Relations guide.Upgrading changes existing data and APIs:
- A reference field that names a target collection becomes a picker and keeps its entries. Fields with no target, fields marked searchable or indexed, and fields whose locales select different entries keep working as before; convert them by hand under Content Types.
- Relations are no longer translated. A relation with different labels per locale keeps one set of labels. The relations API uses
sluginstead ofname, requiresparentCollectionandchildCollectionon create, and no longer acceptslocaleortranslationOf.GET /_emdash/api/relations/:id/translationsis removed, andGET /_emdash/api/relationstakescollectioninstead oflocale. POST /_emdash/api/content/:collection/:id/references/:relation/childrenis removed. Write selections throughreferenceson the content create and update routes instead.relationsis now a reserved collection slug. An existing collection with that slug keeps its content and API, but the admin no longer opens it.
See Reference fields bind to relations for how existing fields are converted.
Patch Changes
-
#3479
35a55a4Thanks @ascorbic! - Updates the empty Plugins screen to open the registry when sandboxed plugin installation is available, or link to the plugin installation guide when it is not. -
#3295
078f167Thanks @ascorbic! - Shows the permissions a CLI or agent is requesting on the admin device authorization page (/_emdash/admin/device) before you approve its code. The page lists the permissions that approval will grant, and separately lists any requested permissions your role does not allow. The Authorize button stays disabled until the code is confirmed valid and at least one requested permission can be granted.A new authenticated
GET /_emdash/api/oauth/device/authorize?user_code=XXXX-XXXXendpoint returns a pending code'srequestedScopesand thegrantedScopesan approval by the current user would receive. Unknown, already-used and expired codes returnINVALID_CODEorEXPIRED_CODE. -
#3478
67ef29dThanks @ascorbic! - Fixes registry plugin installs, updates, and media previews failing on Cloudflare Workers with errors such asThe publisher DID document could not be fetched.Registry HTTPS requests now use the Workers Fetch API instead of unsupported raw TCP sockets. -
#3456
eee003fThanks @ascorbic! - Fixes cached pages continuing to show stale widget areas after an editor changes their widgets.<WidgetArea>now registers its cache dependency automatically, so templates do not need a separate widget-area query to receive invalidation. -
#3451
73103f3Thanks @swissky! - FixesgetEmDashEntrystopping at the first locale that lacks an entry instead of continuing through the locale fallback chain. When the requested locale has no entry, it now returns the entry from the next locale in the chain, withfallbackLocaleset, including in preview and visual-editing mode. An entry that exists in no locale now returnsentry: nullwithout anerror, so pages that checkerrorbeforeentryshow their not-found page instead of a 500 error. -
Updated dependencies [
35a55a4,078f167,a5b4504]:- @emdash-cms/admin@0.41.0
- @emdash-cms/auth@0.41.0
- @emdash-cms/blocks@0.41.0
- @emdash-cms/gutenberg-to-portable-text@0.41.0