Structure Fields Edit and Delete Buttons lead to `The item could not be found` (v2.2.3)

Hey Kirbies

The following blueprint results in Panel reporting The item could not be found whenever a user clicks and entry’s Edit or Delete button:

title: Checkout
pages: true
files: true
fields:
  b_download_message_field:
    label: Success Message
    type:  structure
    required: true
    fields:
      title:
        title: Title
        type: text
      message:
        title: Message
        type: textarea
      type:
        title: Message type
        type: radio
        options:
          1: Success - Valid Charge
          3: Success - Download Started
          2: Error - Download File Missing
          4: Error - Sales File Missing
          8: Error - No Charge ID Passed
          16: Error - Stripe Credit Card Error
          32: Error - Stripe Invalid Request
          64: Error - Invalid Download Token
    help: If error messages are missing, Download will use generic ones.

This seams to affect all Structure fields, even simpler ones. Is this a known issue and is there a fix available already?

Thanks,
Moritz

You use “title” instead of “label” in your blueprint.

title: Checkout
pages: true
files: true
fields:
  b_download_message_field:
    label: Success Message
    type:  structure
    required: true
    fields:
      title:
        label: Title
        type: text
      message:
        label: Message
        type: textarea
      type:
        label: Message type
        type: radio
        options:
          1: Success - Valid Charge
          3: Success - Download Started
          2: Error - Download File Missing
          4: Error - Sales File Missing
          8: Error - No Charge ID Passed
          16: Error - Stripe Credit Card Error
          32: Error - Stripe Invalid Request
          64: Error - Invalid Download Token
    help: If error messages are missing, Download will use generic ones.

Oh-oh. Will try again later. Thanks!

Sorry, @texnixe, but I tried several blueprints and I sill can’t edit or delete any of my Structure field items in v2.2.3. Here are two example blueprints for you to test against:

title: Checkout
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  b_download_message_field:
    label: Success Message
    type:  structure
    fields:
      subject:
        label: Title
        type: text
      message:
        label: Message
        type: textarea
      message_type:
        label: Message type
        type: radio
        options:
          1: Success - Valid Charge
          3: Success - Download Started
          2: Error - Download File Missing
          4: Error - Sales File Missing
          8: Error - No Charge ID Passed
          16: Error - Stripe Credit Card Error
          32: Error - Stripe Invalid Request
          64: Error - Invalid Download Token
    help: If error messages are missing, Download will use generic ones.

[I even tried to avoid both `title` and type as Structure sub-field names. No luck either.]

title: Section
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  b_container_stack:
    label: Containers
    type: structure
    fields:
      container_uri:
        label: Container Instance
        type: page
        default: containers/
    entry: >
      <a href="/panel/pages/{{container_ui}}/edit">{{container_uri}}</a>

Any hints?

Thanks again,
Moritz

Hm, both of your blueprints work in my test install without any problems. Did you start with a fresh Kirby Starterkit or did you update an existing project?

Could you test your blueprints in a fresh Kirby 2.2.3 Starter Kit? Do you test locally or on a remote server?

It’s an updated version running on my local apache.

Pls. check that the panel has really been updated to version 2.2.3; have you had a chance to test this with a new starter kit just in case something went wrong with the update?

All components have been updated to 2.2.3 through git submodules. Can you give me a hint what Panel components my xDebug could watch to track this down?

You could set breakpoints at panel/app/fields/structure/controller.php in line 33 and 65.

First thoughts:

  • Either the update/delete methods get a wrong $entryID as parameter through the structure field route. Could you check what URL appears when you try to edit an entry? And could you provide what’s already in the content file for that structure field? (to see if there is a mismatch between the entryIDs)
  • Or $structure->find($entryId) fails here. Where we’d need some more digging through the code. But for that it would also help to know what’s currently in the content file, so what appears to can’t be found.

Thanks for helping me to track this down. Here are my results from the proposed debugging sessions:

I will try to replace the said htaccess magic with a Kirby router solution to see if I can prohibit forcing all lowercase URLs for Panel.

Anyhow: You might evaluate using lowercase-only $data array keys at your end too.

Thanks again,
Moritz

1 Like