Skip to content

Block multi module browser bug #2278

Open
@rudenav

Description

@rudenav

Description

I have a block with a browser field that produces errors in the log file

Steps to reproduce

  1. Create a block
  2. Define the getForm method with a browser field linked to several modules
    public function getForm(): Form
    {
        return Form::make([
            Browser::make()->name('link')->modules([Page::class, Contact::class]),
        ]);
    }
  1. Select a module and store the form.
  2. When you try edit this record you will get an errors in the log file
local.NOTICE: Twill warning: The url for the "link" browser items can't be resolved. You might be missing a link key in your twill.block_editor.browser_route_prefixes configuration.

and

local.ERROR: Route [twill.link.edit] not defined. {"userId":1,"exception":"[object] (Symfony\\Component\\Routing\\Exception\\RouteNotFoundException(code: 0): Route [twill.link.edit] not defined. at /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:467)

also the link in the form in the browser field on the selected module will be empty

Expected result

The system should look for twill.pages.edit or twill.contacts.edit route respectively.

Actual result

The system looks for an undefined route [twill.link.edit] that based on the browser field name

Versions

Twill version: 3.0.2
Laravel version: 10
PHP version: 8.2
Database engine: Postgresql

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions