Closed khvalov closed 4 years ago
Looking into issue nature I've discovered that in some cases select2-krajee.js is not registered as asset: (Case: when I'm using more than 1 Select 2 widgets with different themes)
there is small workaround / quickfix (not tested for consequences)
Select2.php:
if (in_array($this->theme, self::$_inbuiltThemes)) {
$bundleClass = __NAMESPACE__ . '\Theme' . Inflector::id2camel($this->theme) . 'Asset';
$bundleClass::register($view);
}
update with:
if (in_array($this->theme, self::$_inbuiltThemes)) {
$bundleClass = __NAMESPACE__ . '\Theme' . Inflector::id2camel($this->theme) . 'Asset';
$bundleClass::register($view);
} else {
ThemeAsset::register($view);
}
@kartik-v please advise is it bug?
Not sure I can reproduce an issue here. You can check how you are loading assets on your page and if the asset bundles are loading as intended - else explicitly load the asset bundles on your view if needed. Ensure the dependencies to asset bundles are also correctly configured and loaded.
This issue also happened here after composer updates. The quickfix proposed by khvalov solved the problem.
Facing the same issue after composer update
This happens if you are using any other THEME other than inbuilt themes provided with the widget. If you are using your own theme - just create the asset bundle extending kartik\select2\ThemeAsset
Have issue after composer updates. Looks like Select2 get updated to 4th branch and get this widget broken