Skip to content

[Bug] Translatable + Dropdown buttons do not work together #5846

Closed

Description

@tabacitu

Bug report

Please note: All issues must be submitted in English. If not, they will be closed automatically.

What I did

In a project @maurohmartinez had to use two of our features together:

  • multi-language entities
  • CRUD dropdown buttons

What I expected to happen

Dropdown buttons to incorporate the Edit functionality.

What happened

Not that - they broke.

What I've already tried to fix it

Mauro has fixed them this way in the project. Can't say it's final because:

  • when the dropdown is open, it pushes the Delete button off the dropdown;
  • when the dropdown is not enabled, it make the whole CRUD look weird (it's maybe display block?!)

But it's a place to start!

CleanShot.2025-08-06.at.08.58.57.mp4

resources/views/vendor/backpack/crud/buttons/show.blade.php:

@if ($crud->hasAccess('show', $entry))
    @if (!$crud->model->translationEnabled() || !\App\Services\LocalizationService::supportsMultipleLocales())
        <a href="{{ url($crud->route.'/'.$entry->getKey().'/show') }}" bp-button="show" class="btn btn-sm btn-link">
            <i class="la la-eye"></i> <span>{{ trans('backpack::crud.preview') }}</span>
        </a>
    @else
        <div>
            <a class="btn btn-sm btn-link dropdown-toggle text-primary pl-1" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                {{ trans('backpack::crud.preview') }} <span class="caret"></span>
            </a>
            <ul class="dropdown-menu dropdown-menu-right">
                <li class="dropdown-header">{{ trans('backpack::crud.preview') }}:</li>
                @foreach ($crud->model->getAvailableLocales() as $key => $locale)
                    <a class="dropdown-item" href="{{ url($crud->route.'/'.$entry->getKey().'/show') }}?_locale={{ $key }}">{{ $locale }}</a>
                @endforeach
            </ul>
        </div>
    @endif
@endif

resources/views/vendor/backpack/crud/buttons/update.blade.php:

@if ($crud->hasAccess('update', $entry))
    @if (!$crud->model->translationEnabled() || !\App\Services\LocalizationService::supportsMultipleLocales())
        <a href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}" bp-button="update" class="btn btn-sm btn-link">
            <i class="la la-edit"></i> <span>{{ trans('backpack::crud.edit') }}</span>
        </a>
    @else
        <div>
            <a class="btn btn-sm btn-link dropdown-toggle text-primary pl-1" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                {{ trans('backpack::crud.edit') }} <span class="caret"></span>
            </a>
            <ul class="dropdown-menu dropdown-menu-right">
                <li class="dropdown-header">{{ trans('backpack::crud.edit_translations') }}:</li>
                @foreach ($crud->model->getAvailableLocales() as $key => $locale)
                    <a class="dropdown-item" href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}?_locale={{ $key }}">{{ $locale }}</a>
                @endforeach
            </ul>
        </div>
    @endif
@endif

Is it a bug in the latest version of Backpack?

This is a bug in Backpack v6 latest yes.

Activity

  1. added theissue type on Aug 6, 2025
  2. moved this to Todo in Triageon Aug 6, 2025
  3. tabacitu commented on Aug 11, 2025

    @tabacitu
    MemberAuthor

    Additionally, now that we're implementing translatable into another live project, I think it would be MUCH easier for the admin to handle multi-language entities by NOT seeing all the complexity.

    I would add a feature flag for this functionality, of having a dropdown with all languages in the Show & Update buttons. And I would make it DISABLED by default in v7. It would provide a MUCH better UX for the admin in the Show view to only see this:

    Image

    instead of this:

    Image

    They will STILL be able to translate, by going to that Show/Edit page and using the toggle:

    Image

    So yes, it does become two-click instead of one-click. But most admins will NOT intend to translate all the time... (especially when we introduce AI-translation), so it's OK for this to be two-click... since it benefits the UI/UX of the Show operation in the 99% use case.


    TLDR: I would create two new configs:

    • showLanguagesDirectlyInEditButton (default false in v7)
    • showLanguagesDirectlyInShowButton (default false in v7)
  4. blondie63 commented on Dec 23, 2025

    @blondie63

    Hi, @tabacitu some news about this issue ?
    same of my Laravel-Backpack/community-forum#1432

  5. pxpm commented on Dec 26, 2025

    @pxpm
    Contributor

    Thanks @tabacitu

    I've released a new version (7.0.15) that should have this issue tackled.

    It supports both your suggestions, it works with dropdowns as before, but I also added an operation setting to disable that behavior completely.

    Image Image

    Hope you enjoy it 👍

    Cheers

  6. moved this from Todo to Done in Triageon Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions