composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
|
|
@ -9,24 +9,37 @@
|
|||
* Implements hook_library_info_alter().
|
||||
*/
|
||||
function webform_library_info_alter(&$libraries, $extension) {
|
||||
$webform_libraries_modules = \Drupal::moduleHandler()->getImplementations('webform_libraries_info');
|
||||
$webform_libraries_modules[] = 'webform';
|
||||
|
||||
// Only alter modules that declare webform libraries.
|
||||
// @see hook_webform_libraries_info()
|
||||
$webform_libraries_modules = \Drupal::moduleHandler()->getImplementations('webform_libraries_info');
|
||||
$webform_libraries_modules[] = 'webform';
|
||||
if (!in_array($extension, $webform_libraries_modules)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent duplicate instances of the chosen plugin and use
|
||||
// the chosen_lib.module's as the dependency.
|
||||
if (isset($libraries['webform.element.chosen']) && \Drupal::moduleHandler()->moduleExists('chosen_lib')) {
|
||||
$dependencies =& $libraries['webform.element.chosen']['dependencies'];
|
||||
foreach ($dependencies as $index => $dependency) {
|
||||
if ($dependency === 'webform/libraries.jquery.chosen') {
|
||||
$dependencies[$index] = 'chosen_lib/chosen';
|
||||
$dependencies[] = 'chosen_lib/chosen.css';
|
||||
break;
|
||||
// If chosen_lib.module is installed, then update the dependency.
|
||||
if (\Drupal::moduleHandler()->moduleExists('chosen_lib')) {
|
||||
if (isset($libraries['webform.element.chosen'])) {
|
||||
$dependencies =& $libraries['webform.element.chosen']['dependencies'];
|
||||
foreach ($dependencies as $index => $dependency) {
|
||||
if ($dependency === 'webform/libraries.jquery.chosen') {
|
||||
$dependencies[$index] = 'chosen_lib/chosen';
|
||||
$dependencies[] = 'chosen_lib/chosen.css';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If select2.module is installed, then update the dependency.
|
||||
if (\Drupal::moduleHandler()->moduleExists('select2')) {
|
||||
if (isset($libraries['webform.element.select2'])) {
|
||||
$dependencies =& $libraries['webform.element.select2']['dependencies'];
|
||||
foreach ($dependencies as $index => $dependency) {
|
||||
if ($dependency === 'webform/libraries.jquery.select2') {
|
||||
$dependencies[$index] = 'select2/select2';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +56,11 @@ function webform_library_info_alter(&$libraries, $extension) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Skip libraries installed by other modules.
|
||||
if (isset($library['module'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($library['dependencies'])) {
|
||||
// Remove excluded libraries from dependencies.
|
||||
foreach ($library['dependencies'] as $dependency_index => $dependency_name) {
|
||||
|
|
|
|||
Reference in a new issue