When custom version is set to 1.4, the default changes and 1.4 is dublicated in the list of default version

Created on 7 September 2023, over 1 year ago

Problem/Motivation

If we set the custom version as 1.4 the next problems appear:
1. 1.4 version is duplicated in the 'Default jQuery version' select list (see picture).
2. The default version is set to 1.4 but is should happen only if the custom version is new https://git.drupalcode.org/project/jquery_update/-/blob/7.x-4.x/jquery_u....

Proposed resolution

I think it happens because of using key 'default' instead of '1.4' in jquery_update_get_version_options():

function jquery_update_get_version_options($empty = TRUE) {
  $options = array_merge(array(
    '' => t('Site default (!version)', array(
      '!version' => variable_get('jquery_update_jquery_version', JQUERY_UPDATE_DEFAULT_JQUERY_VERSION),
    )),
    'default' => t('1.4 (Drupal core)'),
  ), jquery_update_get_supported_version_options());

Is it safe to replace it?

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024