e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
318 stars 212 forks source link

[Bug]: wrong displayed library path in Library prefs #5135

Open Jimmi08 opened 6 months ago

Jimmi08 commented 6 months ago

What e107 version are you using?

v2.3.3

Bug description

In Preferences, you have listed libraries. If you use the theme library and alter config method, core paths are always displayed.

But I checked that the libraries are loaded correctly $libraries = $lib->info(); image And if I do a mistake in config, I got error warning with wrong status, so I know that this is working.

The problem is only with displaying this changes values: $details = $lib->detect($machineName); I wasn't able to get further.

If somebody without looking in the theme code checks this, they will don't know that the different bootstrap version is used. Thanks

How to reproduce

This theme_library.php is used from somebody else theme

    /**
     * Alters library information before detection and caching take place.
     */
    function config_alter(&$libraries)
    {
        // Bootstrap (CDN).
        $libraries['cdn.bootstrap5']['library_path'] = 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.2';
        $libraries['cdn.bootstrap5']['path'] = '';
        $libraries['cdn.bootstrap5']['version_arguments']['pattern'] = '/(\d\.\d\.\d\-[a-z]*)/';

        // Bootstrap (local).
        $libraries['bootstrap5']['library_path'] = '{THEME}';
        $libraries['bootstrap5']['path'] = '';
        $libraries['bootstrap5']['theme'] = '';
        $libraries['bootstrap5']['version'] = '5.3.2';      
        $libraries['bootstrap5']['version_arguments']['pattern'] = '/(\d\.\d\.\d\-[a-z]*)/';
    }

But you can test this with bootstrap 3 theme too.

It should unset cdn.bootstrap and bootstrap keys, so they shouldn't be listed there.

Expected behavior

Maybe I don't understand the purpose of this list.

But the confusing part is that if I do mistake in theme library file, it displays it and path and version are correct. image

Thanks

What browser(s) are you seeing the problem on?

Chrome / Brave

PHP Version

PHP 8.1