gearsdigital / enhanced-toolbar-link-dialog

Extend Kirby's default link dialog with search functionality, allowing you to easily create links to existing or external pages at your fingertips.
MIT License
62 stars 8 forks source link

Cannot delete custom url pages #68

Closed Maybach91 closed 2 years ago

Maybach91 commented 2 years ago

What i’m doing: I have a event with a date, when it happens. I want to add the date of the event to the slug of the page. e.g. EventXYZ happens on 02.08.2022 which should create a slug eventxyz-02-08-2022. This is currently working as expected. But unfortunately i cannot delete these “custom” generated pages. It shows me the following error after i clicked on "Delete": image

blueprint.yml:

addFields:
  title:
    label: Titel
    type: text
    required: true
    icon: title
    preselect: true

  date:
    label: Datum
    help: Wann findet die Darbietung statt?
    type: date
    display: DD.MM.YYYY
    default: today
    required: true

  __dialog:
    skip: true
    redirect: true

These are the XHR Requests: image

1. Page Fetch: ```json { "$dropdown": { "options": [ { "dialog": { "url": "/pages/darbietungen+test4-20-08-2022/changeTitle", "query": { "select": "title" } }, "icon": "title", "text": "Umbenennen", "disabled": false }, { "dialog": "/pages/darbietungen+test4-20-08-2022/duplicate", "icon": "copy", "text": "Duplizieren", "disabled": false }, "-", { "dialog": { "url": "/pages/darbietungen+test4-20-08-2022/changeTitle", "query": { "select": "slug" } }, "icon": "url", "text": "URL ändern", "disabled": false }, { "dialog": "/pages/darbietungen+test4-20-08-2022/changeStatus", "icon": "preview", "text": "Status ändern", "disabled": false }, { "dialog": "/pages/darbietungen+test4-20-08-2022/changeSort", "icon": "sort", "text": "Position ändern", "disabled": true }, { "dialog": "/pages/darbietungen+test4-20-08-2022/changeTemplate", "icon": "template", "text": "Vorlage ändern", "disabled": true }, "-", { "dialog": "/pages/darbietungen+test4-20-08-2022/delete", "icon": "trash", "text": "Löschen", "disabled": false } ], "code": 200, "path": "dropdowns/pages/darbietungen+test4-20-08-2022", "referrer": "/pages/darbietungen+test4-20-08-2022" } } ```
2. panel/dialogs//pages/darbietungen+test4-20-08-2022/delete Success Response: ```json { "$dialog": { "component": "k-remove-dialog", "props": { "text": "Willst du die Seite test4 wirklich löschen?" }, "code": 200, "path": "dialogs/pages/darbietungen+test4-20-08-2022/delete", "referrer": "/pages/darbietungen+test4-20-08-2022" } } ```
3. panel/dialogs/pages/darbietungen+test4-20-08-2022/delete Error Response: ```json { "$dialog": { "code": 500, "error": "Trying to access array offset on value of type null", "path": "dialogs/pages/darbietungen+test4-20-08-2022/delete", "referrer": "/pages/darbietungen+test4-20-08-2022" } } ```

↑ whats looking odd to me is the dialogs/ prefix in the path. But i don’t know what value the function tries to access, which is null.

gearsdigital commented 2 years ago

Hello @Maybach91, are you sure you're in the right place to report this?

Maybach91 commented 2 years ago

Hello @Maybach91, are you sure you're in the right place to report this?

Umm, maybe not you are right. 😅 First day after long vacation and the brain went some wrong ways, sorry for that.

gearsdigital commented 2 years ago

Haha... Been there, done that. No worries mate :)