Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined variable $formBuilder #2544

Open
rico opened this issue Mar 16, 2024 · 0 comments · May be fixed by #2577
Open

Undefined variable $formBuilder #2544

rico opened this issue Mar 16, 2024 · 0 comments · May be fixed by #2577

Comments

@rico
Copy link

rico commented Mar 16, 2024

Description

After updating form v2 to v3 I get the following error for some of my CMS pages (which are not modules) that extend the twill::layouts.form view.

Undefined variable $formBuilder (View: [...]/vendor/area17/twill/views/layouts/form.blade.php) (View: [...]/vendor/area17/twill/views/layouts/form.blade.php)

For example:

Entry in twill-navigation.php:

'kontakt' => [
    'title' => 'Kontakt',
    'route' => 'twill.kontakt',
],

The controller code:

class PageController extends ModuleController
{
    protected $moduleName = 'pages';

    public function kontakt(PageRepository $page)
    {
        return view('twill.pages.kontakt',
            $this->form(
                $page->byName('kontakt')->id
            )
        );
    }
}

The view:

@extends('twill::layouts.form', [
    'customTitle' => 'Kontakt',
    'editableTitle' => false,
    'contentFieldsetLabel' => 'Eigenschaften',
])

@section('contentFields')

    @formField('wysiwyg', [
        'name' => 'content.body',
        'label' => 'Inhalt',
        'required' => true,
        'toolbarOptions' => [
            ['header' => [2, 3, 4, 5, 6, false]],
            'bold',
            'italic',
            'underline',
            'strike',
            ['list' => 'ordered'],
            ['list' => 'bullet'],
            ['indent' => '-1'],
            ['indent' => '+1'],
            ["align" => []],
            'link',
            "clean",
        ],
    ])
@stop

Steps to reproduce

Open the admin and select the page.

Expected result

No error, $formBuilder should be defined.

Actual result

Error as stated above.

Versions

Twill: 3.2.0
Laravel: v9.52.16
PHP: 8.0.30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant