Laravel-Backpack / theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.
MIT License
21 stars 12 forks source link

[Bug] Latest update breaks the theme #162

Closed MarioVillani closed 4 months ago

MarioVillani commented 4 months ago

Bug report

What I did

Install latest theme tabler version

What I expected to happen

Theme working

What happened

local.ERROR: Undefined variable $withColumns after logging in in Backpack dashboard.

1 /home/myproject/vendor/backpack/theme-tabler/resources/views/components/menu-dropdown.blade.php(43): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()

Context to replicate the bug - Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### LARAVEL VERSION:
10.45.1.0

### BACKPACK PACKAGE VERSIONS:
backpack/backupmanager: v5.0.0
backpack/basset: 1.2.4
backpack/crud: 6.6.3
backpack/generators: v4.0.3
backpack/logmanager: v5.0.1
backpack/permissionmanager: 7.1.1
backpack/pro: dev-main
backpack/revise-operation: 2.0.0
backpack/theme-tabler: 1.2.1
siberfx commented 4 months ago

$withColumns parameter in menu-dropdown.blade.php is a parameter is not defined in component file himself

MarioVillani commented 4 months ago

I think @pxpm fixed that in d124fcb 👍

pxpm commented 4 months ago

Thanks and sorry guys for the bad experience.

Just pushed the fix in 1.2.2.

I didn't wanted to bump crud version and forgot to add the check if the variable is set 🤷

I will add docs too about it tomorrow, basically allows you to create menus like in tabler demo, side by side: image

You will still need to update CRUD if you want to use this new functionality as you saw by this error.

Cheers

Edit, example menu:

<x-backpack::menu-dropdown title=" Pricing" icon="la la-group">
    <x-backpack::menu-dropdown-item title=" A" icon="las la-euro-sign" link="https://example.com" />
        <x-backpack::menu-separator />
        <x-backpack::menu-dropdown title=" A1" icon="la la-group" nested="true">
            <x-backpack::menu-dropdown-item title=" A1.1" icon="las la-euro-sign" link="https://example.com" />
            <x-backpack::menu-dropdown-item title=" A1.2" icon="las la-euro-sign" link="https://example.com" />
            <x-backpack::menu-dropdown title=" B3" icon="la la-group" nested="true" :withColumns="true">
                <x-theme-tabler::menu-dropdown-column>
                    <x-backpack::menu-dropdown-item title=" B3.1" icon="las la-caret-right" link="https://example.com" />
                    <x-backpack::menu-separator />
                    <x-backpack::menu-dropdown-item title=" B3.2" icon="las la-caret-right" link="https://example.com" />
                </x-theme-tabler::menu-dropdown-column>
                <x-theme-tabler::menu-dropdown-column>
                    <x-backpack::menu-dropdown-item title=" B3.1" icon="las la-caret-right" link="https://example.com" />
                    <x-backpack::menu-dropdown-item title=" B3.2" icon="las la-caret-right" link="https://example.com" />
                </x-theme-tabler::menu-dropdown-column>
            </x-backpack::menu-dropdown>
        </x-backpack::menu-dropdown>         
</x-backpack::menu-dropdown>