Bug
POST /_emdash/api/menus/:name/items with type: "link" accepts the request (201) but does not persist custom_url or url. The created item always has custom_url: null.
Reproduction
curl -X POST "https://example.com/_emdash/api/menus/primary/items" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"type":"link","label":"Blog","custom_url":"/blog","sort_order":3}'
Response: 201 Created with "custom_url": null
Also tried "url": "/blog" — same result.
Impact
After upgrading to 0.10.0, our primary and footer menus lost all items (likely due to migration 036_i18n_menus_and_taxonomies). When trying to recreate items via REST API, the URL field is never saved, resulting in all menu links pointing to #.
Workaround
We patched getMenu() output in our layout with a label→URL fallback map:
const menuUrlMap = { 'Blog': '/blog', 'Portfolio': '/portfolio', ... };
function patchMenuUrls(m) {
return { ...m, items: m.items.map(item => ({
...item,
url: (item.url && item.url !== '#') ? item.url : menuUrlMap[item.label] || '#',
})) };
}
Environment
- EmDash 0.10.0
- Cloudflare Workers + D1
- Menu items created via REST API (not admin UI)
Additional note
DELETE /_emdash/api/menus/:name/items/:id also doesn't seem to work — returns the 404 page HTML instead of a JSON response.
Bug
POST /_emdash/api/menus/:name/itemswithtype: "link"accepts the request (201) but does not persistcustom_urlorurl. The created item always hascustom_url: null.Reproduction
Response:
201 Createdwith"custom_url": nullAlso tried
"url": "/blog"— same result.Impact
After upgrading to 0.10.0, our
primaryandfootermenus lost all items (likely due to migration036_i18n_menus_and_taxonomies). When trying to recreate items via REST API, the URL field is never saved, resulting in all menu links pointing to#.Workaround
We patched
getMenu()output in our layout with a label→URL fallback map:Environment
Additional note
DELETE /_emdash/api/menus/:name/items/:idalso doesn't seem to work — returns the 404 page HTML instead of a JSON response.