getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

Error when trying to extend the `blocks` field #4186

Closed moevbiz closed 2 years ago

moevbiz commented 2 years ago

Description

It seems to be currently not possible to extend the blocks (or layout) fields like the docs suggest: https://getkirby.com/docs/reference/plugins/extensions/fields#extending-existing-fields__extending-the-backend when doing this:

Kirby::plugin('my/plugin', [
    'fields' => [
        'extendedblocks' => [
            'extends' => 'blocks',
        ]
],

it results in the following error message in the panel:

Component definition Kirby\Form\Field\BlocksField does not exist in file: [...]/public/kirby/src/Toolkit/Component.php line: 231

To reproduce

  1. Create plugin like above
  2. add an "extendedblocks" field to blueprint
  3. go to page
  4. see error message

Your setup

Kirby Version
3.6.2

additional info:

@afbora said: "It seems that the component class does not support this loading/registering because blocks and layout field are loaded differently from other fields (registering as a class, not as an array). An issue on GitHub would be nice." https://discord.com/channels/525634039965679616/525641819854471168/948168719916474398

distantnative commented 2 years ago

Duplicate of #3961