jeroennoten / Laravel-AdminLTE

Easy AdminLTE integration with Laravel
MIT License
3.78k stars 1.08k forks source link

[BUG] Error - Call to undefined LayoutHerlper::isPreloaderEnabled() #1257

Closed wbetalleluzd closed 3 months ago

wbetalleluzd commented 4 months ago

image

Just updated today.

I comment that and is running now.

{{-- Preloader Animation --}}
{{-- @if($layoutHelper->isPreloaderEnabled())
@include('adminlte::partials.common.preloader')
@endif --}}
dfsmania commented 4 months ago

@wbetalleluzd Please see #1256 , probably you published the package views previously and now you need to follow the complete Update Procedure. In other words, you need to update the previously published views in order to synchronize them with the new package version.

adrianblynch commented 4 months ago

@wbetalleluzd Please see #1256 , probably you published the package views previously and now you need to follow the complete Update Procedure. In other words, you need to update the previously published views in order to synchronize them with the new package version.

Should this have been a major update rather than a minor? I suppose it's a tricky one where publishing is involved.

resslinger commented 4 months ago

I have reverted the patch version v3.9.5 and released the minor version v3.10.0.

dfsmania commented 4 months ago

Oh, we could actually add backward compatibility by adding again LayoutHerlper::isPreloaderEnabled() that just call the method that is now in the PreloaderHelper class, but it will be a redundant method. What do you think @resslinger ?

On the other hand, if you want to access the new features, the review of previously published views is mandatory.

SammyJoseph commented 4 months ago

There was not any method called isPreloaderEnabled() in vendor\jeroennoten\laravel-adminlte\src\Helpers\LayoutHelper.php I added the method after line 24:

/**
     * Check if the preloader animation is enabled.
     *
     * @return bool
     */
    public static function isPreloaderEnabled()
    {
        return config('adminlte.preloader.enabled', false);
    }
dfsmania commented 3 months ago

@SammyJoseph The method was moved to a new class, due to a split-out refactor, it's now on the PreloaderHelper.php class:

https://github.com/jeroennoten/Laravel-AdminLTE/blob/21b94f6d7716ebde46849fcd77ec33c1565794ec/src/Helpers/PreloaderHelper.php#L13

Please, follow the update procedure and update your published views to sync them with the newest package version.

pervilla commented 3 months ago

I solved it with the following: php artisan adminlte:install --only=main_views --force Reference: https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Updating

dfsmania commented 3 months ago

I solved it with the following: php artisan adminlte:install --only=main_views --force Reference: https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Updating

@pervilla You should be careful about using --force, because you will lose previous changes on the published views. You usually publish the views when you need to make a customization. So, it's always recommended to backup your set of published views before executing the previous command.

dfsmania commented 3 months ago

Closed, a solution to the issue was provided!