diff --git a/PATCHES/user-expire-reset-activation-period.patch b/PATCHES/user-expire-reset-activation-period.patch new file mode 100644 index 000000000..199075b36 --- /dev/null +++ b/PATCHES/user-expire-reset-activation-period.patch @@ -0,0 +1,120 @@ +diff --git a/user_expire.module b/user_expire.module +index 4d01061f69b447cdefcd7d6b3e5bdaec09eed438..332ab12a88793eff57e233e298330721627aeb9c 100644 +--- a/user_expire.module ++++ b/user_expire.module +@@ -164,7 +164,7 @@ function user_expire_user_update(&$edit, $account, $category) { + function _user_expire_save($account) { + if (isset($account->user_expiration) && $account->user_expiration) { + if (is_array($account->user_expiration_date) && isset($account->user_expiration_date['month'])) { +- $time_for_datetime = $account->user_expiration_date['year'] . '-' . $account->user_expiration_date['month'] . '-' . $account->user_expiration_date['day']; ++ $time_for_datetime = $account->user_expiration_date['year'] . '-' . $account->user_expiration_date['month'] . '-' . $account->user_expiration_date['day']; + } + else { + $time_for_datetime = $account->user_expiration_date; +@@ -254,7 +254,6 @@ function user_expire_set_expiration($account, $expiration = NULL) { + if (!isset($account->is_new) || !$account->is_new) { + // New accounts can't have a record to delete. + // Existing records (!is_new) might. +- + // Remove user expiration times for this user. + $deleted = db_delete('user_expire') + ->condition('uid', $account->uid) +@@ -483,7 +482,7 @@ function user_expire_mail($key, &$message, $params) { + $message['body'][] = ''; + $message['body'][] = t('Thanks, @site_name', array('@site_name' => variable_get('site_name', 'Drupal.org'))); + } +- else if ($key == 'account_expired') { ++ elseif ($key == 'account_expired') { + // The subject. + $message['subject'] = t('@site_name: Account expired', array('@site_name' => variable_get('site_name', 'Drupal.org'))); + // The body. +@@ -499,3 +498,15 @@ function user_expire_mail($key, &$message, $params) { + $message['body'][] = t('Thanks, @site_name', array('@site_name' => variable_get('site_name', 'Drupal.org'))); + } + } ++ ++/** ++ * Implements hook_user_presave(). ++ * ++ * If the account was blocked but is now active, update the expiry so it is ++ * not re-blocked by the next cron run. ++ */ ++function user_expire_user_presave(&$edit, $account, $category) { ++ if (!empty($account->original) && $account->original->status == 0 && $edit['status'] == 1) { ++ $edit['access'] = REQUEST_TIME; ++ } ++} +diff --git a/user_expire.test b/user_expire.test +index cb9e3bdafc3ef27711b8d1b1c58ad4437257c97b..3d955a99e0c329b64fd837c7f28de875eb926eea 100644 +--- a/user_expire.test ++++ b/user_expire.test +@@ -4,6 +4,9 @@ + * Tests for User expire module. + */ + ++/** ++ * {@inheritdoc} ++ */ + class UserExpireTestCase extends DrupalWebTestCase { + /** + * Implements getInfo(). +@@ -17,6 +20,9 @@ class UserExpireTestCase extends DrupalWebTestCase { + ); + } + ++ /** ++ * {@inheritdoc} ++ */ + public function setUp() { + // Enable User Expire module. + parent::setUp('user_expire'); +@@ -30,11 +36,14 @@ class UserExpireTestCase extends DrupalWebTestCase { + 'administer users', + 'set user expiration', + 'view expiring users report', +- 'administer user expire settings' ++ 'administer user expire settings', + )); + } + +- function testUserExpire() { ++ /** ++ * Run all user_expire tests. ++ */ ++ public function testUserExpire() { + $this->assertTrue($this->basic_account->status, t('User account is currently enabled.')); + user_expire_set_expiration($this->basic_account, REQUEST_TIME - 1); + user_expire_expire_users(array($this->basic_account)); +@@ -142,7 +151,7 @@ class UserExpireTestCase extends DrupalWebTestCase { + user_expire_expire_by_role(); + + // Ensure they are still enabled. +- $this->drupalGet("user/$new_basic_account->uid/edit"); ++ $this->drupalGet("user/{$new_basic_account->uid}/edit"); + $this->assertRaw('type="radio" id="edit-status-1" name="status" value="1" checked="checked" class="form-radio"', t('New user account stays active.')); + + // Age the new user's created by 90+ days. +@@ -151,9 +160,21 @@ class UserExpireTestCase extends DrupalWebTestCase { + // Process it. + user_expire_expire_by_role(); + +- // Ensure they are disabled +- $this->drupalGet("user/$new_basic_account->uid/edit"); ++ // Ensure they are disabled. ++ $this->drupalGet("user/{$new_basic_account->uid}/edit"); + $this->assertRaw('type="radio" id="edit-status-0" name="status" value="0" checked="checked" class="form-radio"', t('User account is currently disabled.')); + ++ // Manually unblock the user. ++ $edit = array(); ++ $edit['status'] = 1; ++ $this->drupalPost("user/{$new_basic_account->uid}/edit", $edit, t('Save')); ++ ++ // Process it. ++ user_expire_expire_by_role(); ++ ++ // Ensure they are still active. ++ $this->drupalGet("user/{$new_basic_account->uid}/edit"); ++ $this->assertRaw('type="radio" id="edit-status-1" name="status" value="1" checked="checked" class="form-radio"', $this->t('User account is currently active.')); + } ++ + } diff --git a/composer.lock b/composer.lock index 0d4dd0dc1..ed51fae2c 100644 --- a/composer.lock +++ b/composer.lock @@ -1508,17 +1508,17 @@ }, { "name": "drupal/context", - "version": "3.11.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/context.git", - "reference": "7.x-3.11" + "reference": "7.x-3.12" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/context-7.x-3.11.zip", - "reference": "7.x-3.11", - "shasum": "7b577980af28d264eeb071b5fab97ec8603296dd" + "url": "https://ftp.drupal.org/files/projects/context-7.x-3.12.zip", + "reference": "7.x-3.12", + "shasum": "c69d450179fbbb0241be29a37b19e09102d408eb" }, "require": { "drupal/ctools": "*", @@ -1527,8 +1527,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "7.x-3.11", - "datestamp": "1658944702", + "version": "7.x-3.12", + "datestamp": "1675905573", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -1766,24 +1766,23 @@ }, { "name": "drupal/ctools", - "version": "1.20.0", + "version": "1.21.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/ctools.git", - "reference": "7.x-1.20" + "reference": "7.x-1.21" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/ctools-7.x-1.20.zip", - "reference": "7.x-1.20", - "shasum": "695e3ac7705d4de343bfd0b7183706fa3203fa52" + "url": "https://ftp.drupal.org/files/projects/ctools-7.x-1.21.zip", + "reference": "7.x-1.21", + "shasum": "005d39917737407efd1a730ef2e2e082227e13c7" }, "require": { "drupal/drupal": "~7.0" }, "require-dev": { "drupal/advanced_help": "*", - "drupal/color-color": "*", "drupal/page_manager": "*", "drupal/panels": "*", "drupal/views": "*" @@ -1791,8 +1790,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "7.x-1.20", - "datestamp": "1642577344", + "version": "7.x-1.21", + "datestamp": "1675152415", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2394,10 +2393,6 @@ "reference": "7.94", "shasum": "4d732bbf9b50a5076e8c353cd77d1a4e879d94a4" }, - "require-dev": { - "drupal/color-color": "*", - "drupal/rdf": "*" - }, "type": "drupal-core", "extra": { "drupal": { @@ -5270,17 +5265,17 @@ }, { "name": "drupal/jquery_update", - "version": "4.0.0", + "version": "4.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/jquery_update.git", - "reference": "7.x-4.0" + "reference": "7.x-4.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/jquery_update-7.x-4.0.zip", - "reference": "7.x-4.0", - "shasum": "3ff1a393c244f506052a26d9cc59020e3661449e" + "url": "https://ftp.drupal.org/files/projects/jquery_update-7.x-4.1.zip", + "reference": "7.x-4.1", + "shasum": "c555b66fc3b353f7045c4004db858c3a75e4fab5" }, "require": { "drupal/drupal": "~7.0" @@ -5288,8 +5283,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "7.x-4.0", - "datestamp": "1669044747", + "version": "7.x-4.1", + "datestamp": "1675437622", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -5646,26 +5641,29 @@ }, { "name": "drupal/linkchecker", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/linkchecker.git", - "reference": "7.x-1.4" + "reference": "7.x-1.5" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/linkchecker-7.x-1.4.zip", - "reference": "7.x-1.4", - "shasum": "aa0f20ccb135d4585433289b70dd2dd5dafa1979" + "url": "https://ftp.drupal.org/files/projects/linkchecker-7.x-1.5.zip", + "reference": "7.x-1.5", + "shasum": "4f63f46b9a55e8dad14923805beceacde8735067" }, "require": { "drupal/drupal": "~7.0" }, + "require-dev": { + "drupal/bean": "*" + }, "type": "drupal-module", "extra": { "drupal": { - "version": "7.x-1.4", - "datestamp": "1534714680", + "version": "7.x-1.5", + "datestamp": "1674441216", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -5688,6 +5686,10 @@ { "name": "hass", "homepage": "https://www.drupal.org/user/85918" + }, + { + "name": "VladimirAus", + "homepage": "https://www.drupal.org/user/673120" } ], "description": "Periodically checks for broken links in node types, blocks and fields and reports the results.", @@ -7161,7 +7163,7 @@ }, { "name": "drupal/page_manager", - "version": "1.20.0", + "version": "1.21.0", "require": { "drupal/ctools": "*", "drupal/drupal": "~7.0" @@ -7169,8 +7171,8 @@ "type": "metapackage", "extra": { "drupal": { - "version": "7.x-1.20", - "datestamp": "1642577344", + "version": "7.x-1.21", + "datestamp": "1675152415", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -10480,13 +10482,13 @@ "GPL-2.0-or-later" ], "authors": [ - { - "name": "RickJ", - "homepage": "https://www.drupal.org/user/3371606" - }, { "name": "killua99", "homepage": "https://www.drupal.org/user/699418" + }, + { + "name": "RickJ", + "homepage": "https://www.drupal.org/user/3371606" } ], "description": "Views plugin to export a view as a PDF file.", diff --git a/composer.patches.json b/composer.patches.json index 8351d5fa4..1d5ff665b 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -104,7 +104,7 @@ "Disable entity loading 2": "PATCHES/shs_lazyload_2.patch" }, "drupal/user_expire": { - "If a user is activated, deactivated by the module, and reactivated by an admin, reset their expiration period": "https://git.drupalcode.org/project/user_expire/-/merge_requests/8.diff", + "If a user is activated, deactivated by the module, and reactivated by an admin, reset their expiration period": "PATCHES/user-expire-reset-activation-period.patch", "OPS-8147: Customise the expiry email text": "PATCHES/user-expire-2836514-mails-hack.patch" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index c34dac2e7..45d6c38b7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /srv/www RUN composer self-update && \ composer install --quiet --no-dev --prefer-dist -FROM public.ecr.aws/unocha/php-k8s:${TAG:-7.4-NR-stable} +FROM public.ecr.aws/unocha/php-k8s:7.4-stable ARG VCS_REF ARG VCS_URL @@ -33,6 +33,7 @@ COPY --from=builder /srv/www/vendor /srv/www/vendor COPY --from=builder /srv/www/composer.json /srv/www/composer.json COPY --from=builder /srv/www/composer.lock /srv/www/composer.lock COPY --from=builder /srv/www/composer.patches.json /srv/www/composer.patches.json +COPY --from=builder /srv/www/docker/fastcgi_drupal.conf /etc/nginx/apps/drupal/fastcgi_drupal.conf COPY --from=builder /srv/www/docker/custom /etc/nginx/custom RUN cd /srv/www/html/sites && \ diff --git a/docker/fastcgi_drupal.conf b/docker/fastcgi_drupal.conf new file mode 100644 index 000000000..be59f8516 --- /dev/null +++ b/docker/fastcgi_drupal.conf @@ -0,0 +1,43 @@ +#-*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*- +### fastcgi configuration for serving private files. +## 1. Parameters. +fastcgi_param QUERY_STRING q=$uri&$args; +fastcgi_param REQUEST_METHOD $request_method; +fastcgi_param CONTENT_TYPE $content_type; +fastcgi_param CONTENT_LENGTH $content_length; + +fastcgi_param SCRIPT_NAME /index.php; +fastcgi_param REQUEST_URI $request_uri; +fastcgi_param DOCUMENT_URI $document_uri; +fastcgi_param DOCUMENT_ROOT $document_root; +fastcgi_param SERVER_PROTOCOL $server_protocol; + +fastcgi_param GATEWAY_INTERFACE CGI/1.1; +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + +fastcgi_param REMOTE_ADDR $remote_addr; +fastcgi_param REMOTE_PORT $remote_port; +fastcgi_param SERVER_ADDR $server_addr; +fastcgi_param SERVER_PORT $server_port; +fastcgi_param SERVER_NAME $server_name; +## PHP only, required if PHP was built with --enable-force-cgi-redirect +fastcgi_param REDIRECT_STATUS 200; +fastcgi_param SCRIPT_FILENAME $document_root/index.php; +## HTTPS 'on' parameter. This requires Nginx version 1.1.11 or +## later. The if_not_empty flag was introduced in 1.1.11. See: +## http://nginx.org/en/CHANGES. If using a version that doesn't +## support this comment out the line below. +fastcgi_param HTTPS $fastcgi_https if_not_empty; +## For Nginx versions below 1.1.11 uncomment the line below after commenting out the above. +#fastcgi_param HTTPS $fastcgi_https; + +## 2. Nginx FCGI specific directives. +fastcgi_buffers 256 4k; +fastcgi_intercept_errors on; +## Allow 4 hrs - pass timeout responsibility to upstream. +fastcgi_read_timeout 14400; +fastcgi_index index.php; +## Hide the X-Drupal-Cache header provided by Pressflow. +fastcgi_hide_header 'X-Drupal-Cache'; +## Hide the Drupal 7 header X-Generator. +fastcgi_hide_header 'X-Generator'; diff --git a/html/sites/all/modules/contrib/context/context.info b/html/sites/all/modules/contrib/context/context.info index 9280e938a..4b1801954 100644 --- a/html/sites/all/modules/contrib/context/context.info +++ b/html/sites/all/modules/contrib/context/context.info @@ -8,8 +8,8 @@ files[] = tests/context.test files[] = tests/context.conditions.test files[] = tests/context.reactions.test -; Information added by Drupal.org packaging script on 2022-07-26 -version = "7.x-3.11" +; Information added by Drupal.org packaging script on 2023-02-09 +version = "7.x-3.12" core = "7.x" project = "context" -datestamp = "1658874334" +datestamp = "1675905575" diff --git a/html/sites/all/modules/contrib/context/context.module b/html/sites/all/modules/contrib/context/context.module index c83b15ef2..93e95ba9e 100644 --- a/html/sites/all/modules/contrib/context/context.module +++ b/html/sites/all/modules/contrib/context/context.module @@ -527,7 +527,7 @@ function context_empty($element) { /** * Get a plugin handler. */ -function context_get_plugin($type = 'condition', $key, $reset = FALSE) { +function context_get_plugin($type, $key, $reset = FALSE) { static $cache = array(); if (!isset($cache[$type][$key]) || $reset) { switch ($type) { diff --git a/html/sites/all/modules/contrib/context/context_layouts/context_layouts.info b/html/sites/all/modules/contrib/context/context_layouts/context_layouts.info index a3e18bffc..d047ec4c6 100644 --- a/html/sites/all/modules/contrib/context/context_layouts/context_layouts.info +++ b/html/sites/all/modules/contrib/context/context_layouts/context_layouts.info @@ -6,8 +6,8 @@ core = 7.x files[] = plugins/context_layouts_reaction_block.inc -; Information added by Drupal.org packaging script on 2022-07-26 -version = "7.x-3.11" +; Information added by Drupal.org packaging script on 2023-02-09 +version = "7.x-3.12" core = "7.x" project = "context" -datestamp = "1658874334" +datestamp = "1675905575" diff --git a/html/sites/all/modules/contrib/context/context_ui/context_ui.info b/html/sites/all/modules/contrib/context/context_ui/context_ui.info index 8f282f3e3..83fd05708 100644 --- a/html/sites/all/modules/contrib/context/context_ui/context_ui.info +++ b/html/sites/all/modules/contrib/context/context_ui/context_ui.info @@ -8,8 +8,8 @@ configure = admin/structure/context files[] = context.module files[] = tests/context_ui.test -; Information added by Drupal.org packaging script on 2022-07-26 -version = "7.x-3.11" +; Information added by Drupal.org packaging script on 2023-02-09 +version = "7.x-3.12" core = "7.x" project = "context" -datestamp = "1658874334" +datestamp = "1675905575" diff --git a/html/sites/all/modules/contrib/context/plugins/context_condition_context_all.inc b/html/sites/all/modules/contrib/context/plugins/context_condition_context_all.inc index faecbb346..ad4c0fc1a 100644 --- a/html/sites/all/modules/contrib/context/plugins/context_condition_context_all.inc +++ b/html/sites/all/modules/contrib/context/plugins/context_condition_context_all.inc @@ -13,8 +13,18 @@ class context_condition_context_all extends context_condition_path { // and have values set. if (!in_array($context->name, $active_contexts, TRUE) && $values = $this->fetch_from_context($context, 'values')) { + $contexts_matched = 0; + + // Count the matched contexts + foreach($values as $value) { + // Always check against the active contexts. + if ($this->match(array_keys(context_active_contexts()), array($value))) { + $contexts_matched++; + } + } + // The condition is met if all contexts are active. - if (count(array_intersect($values, $active_contexts)) == count($values)) { + if ($contexts_matched == count($values)) { $this->condition_met($context); } } @@ -26,4 +36,46 @@ class context_condition_context_all extends context_condition_path { } } } + + /** + * Retrieve all context conditions. + * + * This method is slightly adapted to context_condition::get_contexts() in + * order to ensure that a context that is used as condition in another context + * gets handled before. + */ + function get_contexts($value = NULL) { + $map = context_condition_map(); + $map = isset($map[$this->plugin]) ? $map[$this->plugin] : array(); + + $contexts = array(); + + // Add the contexts that are needed for conditions in the other contexts + // first. Start with the negated ones first, as we can not unset a met + // condition afterwards. + krsort($map); + foreach ($map as $key => $submap) { + // Negated context conditions start with a "~". + if (substr($key, 0, 1) == "~") { + $key = substr($key, 1); + } + if (!isset($contexts[$key])) { + $context = context_load($key); + // Check if context exists. This will fail for wildcards. + if ($context) { + $contexts[$context->name] = $context; + } + } + } + foreach ($map as $key => $submap) { + foreach ($submap as $name) { + if (!isset($contexts[$name])) { + $context = context_load($name); + $contexts[$context->name] = $context; + } + } + } + + return $contexts; + } } diff --git a/html/sites/all/modules/contrib/context/plugins/context_condition_user.inc b/html/sites/all/modules/contrib/context/plugins/context_condition_user.inc index f7184f007..a6d62ccca 100644 --- a/html/sites/all/modules/contrib/context/plugins/context_condition_user.inc +++ b/html/sites/all/modules/contrib/context/plugins/context_condition_user.inc @@ -20,12 +20,45 @@ class context_condition_user extends context_condition { return $values; } + function options_form($context) { + $defaults = $this->fetch_from_context($context, 'options'); + return array( + 'negate_role' => array( + '#title' => t('Make role a negative condition'), + '#type' => 'checkbox', + '#description' => t("Checking this box will make this condition fire if the user's role is NOT one of the role's checked"), + '#default_value' => isset($defaults['negate_role']) ? $defaults['negate_role'] : 0, + ), + ); + } + function execute($account) { - $roles = $account->roles; - foreach ($roles as $rid => $role) { + $all_roles = user_roles(); + $users_roles = $account->roles; + foreach ($all_roles as $rid => $role) { foreach ($this->get_contexts($role) as $context) { - $this->condition_met($context, $role); + $options = $this->fetch_from_context($context, 'options'); + if (empty($options['negate_role'])) { + if (in_array($role, $users_roles)){ + $this->condition_met($context, $role); + } + } + else { + $negate_flag = TRUE; + foreach ($this->fetch_from_context($context, 'values') as $nid => $negated_role) { + if (!in_array($negated_role, $users_roles)) { + $negate_flag &= TRUE; + } + else { + $negate_flag &= FALSE; + } + } + if ($negate_flag) { + $this->condition_met($context, $role); + } + } } } } + } diff --git a/html/sites/all/modules/contrib/context/plugins/context_reaction_block.js b/html/sites/all/modules/contrib/context/plugins/context_reaction_block.js index 42bcdfa5f..8d1042c1d 100644 --- a/html/sites/all/modules/contrib/context/plugins/context_reaction_block.js +++ b/html/sites/all/modules/contrib/context/plugins/context_reaction_block.js @@ -425,7 +425,7 @@ DrupalContextBlockEditor.prototype = { $('a.context_ui_dialog-stop').hide(); $('.editing-context-label').remove(); - var label = $('#context-editable-trigger-'+context+' .label').text(); + var label = $('#context-editable-trigger-'+context+' .label.top').text(); label = Drupal.t('Now editing: @label', {'@label': label}); editor.parent().parent().prepend('
' + label + '
'); diff --git a/html/sites/all/modules/contrib/context/tests/context.conditions.test b/html/sites/all/modules/contrib/context/tests/context.conditions.test index a55276b7e..f18ec7b7d 100644 --- a/html/sites/all/modules/contrib/context/tests/context.conditions.test +++ b/html/sites/all/modules/contrib/context/tests/context.conditions.test @@ -49,6 +49,44 @@ class ContextConditionUserTest extends DrupalWebTestCase { } } +class ContextConditionNagateUserTest extends DrupalWebTestCase { + protected $profile = 'testing'; + + public static function getInfo() { + return array( + 'name' => 'Condition: nagate user', + 'description' => 'Test nagate user condition.', + 'group' => 'Context', + ); + } + + function setUp() { + parent::setUp('context', 'ctools'); + $this->user1 = $this->drupalCreateUser(array('access content', 'administer site configuration')); + + // Create test context. + ctools_include('export'); + $this->context = ctools_export_new_object('context'); + $this->context->name = 'testcontext'; + $this->context->conditions = array('user' => array('values' => array('authenticated user' => 'authenticated user'), 'options' => array('negate_role' => 1))); + $this->context->reactions = array('debug' => array('debug' => TRUE)); + $saved = context_save($this->context); + $this->assertTrue($saved, "Context 'testcontext' saved."); + } + + function test() { + // User 1 does not trigger the context. + $this->drupalLogin($this->user1); + $this->drupalGet('node'); + $this->assertNoText('Active context: testcontext'); + + // Anonymous triggers the context. + $this->drupalLogout(); + $this->drupalGet(''); + $this->assertText('Active context: testcontext'); + } +} + class ContextConditionUserPageTest extends DrupalWebTestCase { protected $profile = 'testing'; diff --git a/html/sites/all/modules/contrib/ctools/bulk_export/bulk_export.info b/html/sites/all/modules/contrib/ctools/bulk_export/bulk_export.info index f33644a5e..96a230940 100644 --- a/html/sites/all/modules/contrib/ctools/bulk_export/bulk_export.info +++ b/html/sites/all/modules/contrib/ctools/bulk_export/bulk_export.info @@ -1,11 +1,11 @@ name = Bulk Export description = Performs bulk exporting of data objects known about by Chaos tools. core = 7.x -dependencies[] = ctools +dependencies[] = ctools:ctools package = Chaos tool suite -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools.info b/html/sites/all/modules/contrib/ctools/ctools.info index 2c2ffe71b..c4b3d5777 100644 --- a/html/sites/all/modules/contrib/ctools/ctools.info +++ b/html/sites/all/modules/contrib/ctools/ctools.info @@ -19,8 +19,8 @@ files[] = tests/object_cache.test files[] = tests/object_cache_unit.test files[] = tests/page_tokens.test -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/html/sites/all/modules/contrib/ctools/ctools_access_ruleset/ctools_access_ruleset.info index 0702f99c8..e8d3c1313 100644 --- a/html/sites/all/modules/contrib/ctools/ctools_access_ruleset/ctools_access_ruleset.info +++ b/html/sites/all/modules/contrib/ctools/ctools_access_ruleset/ctools_access_ruleset.info @@ -2,10 +2,10 @@ name = Custom rulesets description = Create custom, exportable, reusable access rulesets for applications like Panels. core = 7.x package = Chaos tool suite -dependencies[] = ctools +dependencies[] = ctools:ctools -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/html/sites/all/modules/contrib/ctools/ctools_ajax_sample/ctools_ajax_sample.info index 2b9f84850..742126552 100644 --- a/html/sites/all/modules/contrib/ctools/ctools_ajax_sample/ctools_ajax_sample.info +++ b/html/sites/all/modules/contrib/ctools/ctools_ajax_sample/ctools_ajax_sample.info @@ -1,11 +1,11 @@ name = Chaos Tools (CTools) AJAX Example description = Shows how to use the power of Chaos AJAX. package = Chaos tool suite -dependencies[] = ctools +dependencies[] = ctools:ctools core = 7.x -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools_custom_content/ctools_custom_content.info b/html/sites/all/modules/contrib/ctools/ctools_custom_content/ctools_custom_content.info index cbd53ed13..3289120b2 100644 --- a/html/sites/all/modules/contrib/ctools/ctools_custom_content/ctools_custom_content.info +++ b/html/sites/all/modules/contrib/ctools/ctools_custom_content/ctools_custom_content.info @@ -2,10 +2,10 @@ name = Custom content panes description = Create custom, exportable, reusable content panes for applications like Panels. core = 7.x package = Chaos tool suite -dependencies[] = ctools +dependencies[] = ctools:ctools -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools_plugin_example/ctools_plugin_example.info b/html/sites/all/modules/contrib/ctools/ctools_plugin_example/ctools_plugin_example.info index 940807644..fab0684f0 100644 --- a/html/sites/all/modules/contrib/ctools/ctools_plugin_example/ctools_plugin_example.info +++ b/html/sites/all/modules/contrib/ctools/ctools_plugin_example/ctools_plugin_example.info @@ -1,14 +1,14 @@ name = Chaos Tools (CTools) Plugin Example description = Shows how an external module can provide ctools plugins (for Panels, etc.). -package = Chaos tool suite -dependencies[] = ctools -dependencies[] = panels -dependencies[] = page_manager -dependencies[] = advanced_help core = 7.x +package = Chaos tool suite +dependencies[] = advanced_help:advanced_help +dependencies[] = ctools:ctools +dependencies[] = ctools:page_manager +dependencies[] = panels:panels -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc b/html/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc index 087d5ecf2..31d7b00b3 100644 --- a/html/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc +++ b/html/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc @@ -24,7 +24,7 @@ $plugin = array( /** * Return a new context based on an existing context. */ -function ctools_relcontext_from_simplecontext_context($context = NULL, $conf) { +function ctools_relcontext_from_simplecontext_context($context, $conf) { // If unset it wants a generic, unfilled context, which is just NULL. if (empty($context->data)) { return ctools_context_create_empty('relcontext', NULL); diff --git a/html/sites/all/modules/contrib/ctools/includes/ajax.inc b/html/sites/all/modules/contrib/ctools/includes/ajax.inc index 4d72d0c6b..12f62ffb6 100644 --- a/html/sites/all/modules/contrib/ctools/includes/ajax.inc +++ b/html/sites/all/modules/contrib/ctools/includes/ajax.inc @@ -153,6 +153,9 @@ function ctools_ajax_command_submit($selector) { * Send an error response back via AJAX and immediately exit. */ function ctools_ajax_render_error($error = '') { + if (!$error) { + $error = t('An error occurred while handling the request: The server received invalid input.'); + } $commands = array(); $commands[] = ajax_command_alert($error); print ajax_render($commands); diff --git a/html/sites/all/modules/contrib/ctools/includes/cleanstring.inc b/html/sites/all/modules/contrib/ctools/includes/cleanstring.inc index 11ffceff6..3fd62b6fb 100644 --- a/html/sites/all/modules/contrib/ctools/includes/cleanstring.inc +++ b/html/sites/all/modules/contrib/ctools/includes/cleanstring.inc @@ -11,6 +11,7 @@ * @code * ctools_include('cleanstring'); * $output = ctools_cleanstring($string); + * @endcode * * You can add a variety of settings as an array in the second argument, * including words to ignore, how to deal with punctuation, length diff --git a/html/sites/all/modules/contrib/ctools/includes/context-access-admin.inc b/html/sites/all/modules/contrib/ctools/includes/context-access-admin.inc index d8c4f3b14..934c36fc9 100644 --- a/html/sites/all/modules/contrib/ctools/includes/context-access-admin.inc +++ b/html/sites/all/modules/contrib/ctools/includes/context-access-admin.inc @@ -77,6 +77,7 @@ * ctools_include('object-cache'); * ctools_object_cache_set("$module:argument", $access); * } + * @endcode * * To utilize this form: * @code @@ -101,6 +102,7 @@ * @code{ * $form = ctools_access_admin_form($form, $form_state); * } + * @endcode * * You'll be responsible for adding a submit button. * @@ -454,7 +456,7 @@ function ctools_access_ajax_delete($fragment = NULL, $id = NULL) { ctools_include('context'); if (empty($fragment) || !isset($id)) { - ajax_render_error(); + ctools_ajax_render_error(); } // Separate the fragment into 'module' and 'argument'. @@ -468,7 +470,7 @@ function ctools_access_ajax_delete($fragment = NULL, $id = NULL) { $function = $module . '_ctools_access_get'; if (!function_exists($function)) { - ajax_render_error(t('Missing callback hooks.')); + ctools_ajax_render_error(t('Missing callback hooks.')); } list($access, $contexts) = $function($argument); diff --git a/html/sites/all/modules/contrib/ctools/includes/context.inc b/html/sites/all/modules/contrib/ctools/includes/context.inc index 6c136698b..7cb3ae7ac 100644 --- a/html/sites/all/modules/contrib/ctools/includes/context.inc +++ b/html/sites/all/modules/contrib/ctools/includes/context.inc @@ -26,6 +26,7 @@ * common, such as titles, data, keywords, etc. In particulare, the 'type' * of the context is important. */ +#[\AllowDynamicProperties] class ctools_context { /** * @var string|array @@ -75,6 +76,16 @@ class ctools_context { */ public $original_argument; + /** + * @var + */ + public $id; + + /** + * @var + */ + public $plugin; + /** * @var array */ @@ -204,6 +215,7 @@ class ctools_context { * Used to create a method of comparing if a list of contexts * match a required context type. */ +#[\AllowDynamicProperties] class ctools_context_required { /** * @var array @@ -386,6 +398,7 @@ class ctools_context_required { * Used to compare to see if a list of contexts match an optional context. This * can produce empty contexts to use as placeholders. */ +#[\AllowDynamicProperties] class ctools_context_optional extends ctools_context_required { /** @@ -1673,7 +1686,9 @@ function ctools_context_load_contexts($object, $placeholders = TRUE, $contexts = * * This function is used to figure out which contexts represents 'the form' * from a list of contexts. Only one contexts can actually be 'the form' for - * a given page, since the @code{
} tag can not be embedded within + * a given page, since the @code + * {} + * @endcode tag can not be embedded within * itself. */ function ctools_context_get_form($contexts) { diff --git a/html/sites/all/modules/contrib/ctools/includes/dependent.inc b/html/sites/all/modules/contrib/ctools/includes/dependent.inc index 20c25ded8..51b2f2a40 100644 --- a/html/sites/all/modules/contrib/ctools/includes/dependent.inc +++ b/html/sites/all/modules/contrib/ctools/includes/dependent.inc @@ -37,10 +37,14 @@ * Usage: * * First, ensure this tool is loaded: - * @code { ctools_include('dependent'); } + * @code + * { ctools_include('dependent'); } + * @endcode * * On any form item, add - * - @code '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)), @endcode + * @code + * '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)), + * @endcode * * A fuller example, that hides the menu title when no menu is selected: * @code @@ -71,7 +75,7 @@ * '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')), * ); * - * return system_settings_form($form); + * return system_settings_form($form); * } * @endcode * diff --git a/html/sites/all/modules/contrib/ctools/includes/entity-access.inc b/html/sites/all/modules/contrib/ctools/includes/entity-access.inc index 69f2c335d..8140f51a6 100644 --- a/html/sites/all/modules/contrib/ctools/includes/entity-access.inc +++ b/html/sites/all/modules/contrib/ctools/includes/entity-access.inc @@ -99,7 +99,7 @@ function ctools_metadata_no_hook_node_access($op, $node = NULL, $account = NULL) /** * Access callback for the user entity. */ -function ctools_metadata_user_access($op, $entity = NULL, $account = NULL, $entity_type) { +function ctools_metadata_user_access($op, $entity, $account , $entity_type) { $account = isset($account) ? $account : $GLOBALS['user']; // Grant access to the users own user account and to the anonymous one. if (isset($entity) && $op != 'delete' && (($entity->uid == $account->uid && $entity->uid) || (!$entity->uid && $op == 'view'))) { @@ -143,7 +143,8 @@ function ctools_metadata_comment_access($op, $entity = NULL, $account = NULL) { /** * Access callback for the taxonomy entities. */ -function ctools_metadata_taxonomy_access($op, $entity = NULL, $account = NULL, $entity_type) { +function ctools_metadata_taxonomy_access($op, $entity, $account, $entity_type) { + if ($entity_type == 'taxonomy_vocabulary') { return user_access('administer taxonomy', $account); } diff --git a/html/sites/all/modules/contrib/ctools/includes/modal.inc b/html/sites/all/modules/contrib/ctools/includes/modal.inc index 30eadbf40..ea88d932a 100644 --- a/html/sites/all/modules/contrib/ctools/includes/modal.inc +++ b/html/sites/all/modules/contrib/ctools/includes/modal.inc @@ -15,6 +15,7 @@ * ctools_include('modal'); * ctools_modal_add_js(); * } + * @endcode * * You can have links and buttons bound to use the modal by adding the * class ctools-use-modal. diff --git a/html/sites/all/modules/contrib/ctools/page_manager/page_manager.info b/html/sites/all/modules/contrib/ctools/page_manager/page_manager.info index 8b43b7adf..a863f69b9 100644 --- a/html/sites/all/modules/contrib/ctools/page_manager/page_manager.info +++ b/html/sites/all/modules/contrib/ctools/page_manager/page_manager.info @@ -1,13 +1,13 @@ name = Page manager description = Provides a UI and API to manage pages within the site. core = 7.x -dependencies[] = ctools +dependencies[] = ctools:ctools package = Chaos tool suite files[] = tests/head_links.test -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php b/html/sites/all/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php index f78795aad..3ab6807da 100644 --- a/html/sites/all/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php +++ b/html/sites/all/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php @@ -3,6 +3,7 @@ /** * Base class for export UI. */ +#[\AllowDynamicProperties] class ctools_export_ui { var $plugin; var $name; diff --git a/html/sites/all/modules/contrib/ctools/stylizer/stylizer.info b/html/sites/all/modules/contrib/ctools/stylizer/stylizer.info index cc62aca4f..0d216f244 100644 --- a/html/sites/all/modules/contrib/ctools/stylizer/stylizer.info +++ b/html/sites/all/modules/contrib/ctools/stylizer/stylizer.info @@ -2,11 +2,11 @@ name = Stylizer description = Create custom styles for applications such as Panels. core = 7.x package = Chaos tool suite -dependencies[] = ctools -dependencies[] = color +dependencies[] = ctools:ctools +dependencies[] = drupal:color -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/term_depth/term_depth.info b/html/sites/all/modules/contrib/ctools/term_depth/term_depth.info index cc3ebfca4..38607715a 100644 --- a/html/sites/all/modules/contrib/ctools/term_depth/term_depth.info +++ b/html/sites/all/modules/contrib/ctools/term_depth/term_depth.info @@ -1,11 +1,11 @@ name = Term Depth access description = Controls access to context based upon term depth core = 7.x -dependencies[] = ctools +dependencies[] = ctools:ctools package = Chaos tool suite -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools_export_test.info b/html/sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools_export_test.info index 6d677e3f3..4c17ed5de 100644 --- a/html/sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools_export_test.info +++ b/html/sites/all/modules/contrib/ctools/tests/ctools_export_test/ctools_export_test.info @@ -2,13 +2,13 @@ name = CTools export test description = CTools export test module core = 7.x package = Chaos tool suite -dependencies[] = ctools +dependencies[] = ctools:ctools hidden = TRUE files[] = ctools_export.test -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/tests/ctools_plugin_test.info b/html/sites/all/modules/contrib/ctools/tests/ctools_plugin_test.info index 5867924fc..c60cb85d5 100644 --- a/html/sites/all/modules/contrib/ctools/tests/ctools_plugin_test.info +++ b/html/sites/all/modules/contrib/ctools/tests/ctools_plugin_test.info @@ -2,11 +2,11 @@ name = Chaos tools plugins test description = Provides hooks for testing ctools plugins. package = Chaos tool suite core = 7.x -dependencies[] = ctools +dependencies[] = ctools:ctools hidden = TRUE -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/views_content/tests/modules/views_content_test.info b/html/sites/all/modules/contrib/ctools/views_content/tests/modules/views_content_test.info index c4073caef..6b8c49e81 100644 --- a/html/sites/all/modules/contrib/ctools/views_content/tests/modules/views_content_test.info +++ b/html/sites/all/modules/contrib/ctools/views_content/tests/modules/views_content_test.info @@ -1,11 +1,12 @@ name = Views content panes Test description = Test module for Views content panes. -package = Views core = 7.x -dependencies[] = views_content +package = Views +dependencies[] = ctools:views_content hidden = TRUE -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" + +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/ctools/views_content/views_content.info b/html/sites/all/modules/contrib/ctools/views_content/views_content.info index 0335e026d..38d951c06 100644 --- a/html/sites/all/modules/contrib/ctools/views_content/views_content.info +++ b/html/sites/all/modules/contrib/ctools/views_content/views_content.info @@ -1,17 +1,16 @@ name = Views content panes description = Allows Views content to be used in Panels, Dashboard and other modules which use the CTools Content API. -package = Views -dependencies[] = ctools -dependencies[] = views core = 7.x package = Chaos tool suite +dependencies[] = ctools:ctools +dependencies[] = views:views files[] = plugins/views/views_content_plugin_display_ctools_context.inc files[] = plugins/views/views_content_plugin_display_panel_pane.inc files[] = plugins/views/views_content_plugin_style_ctools_context.inc files[] = tests/src/views_content.test -; Information added by Drupal.org packaging script on 2022-01-19 -version = "7.x-1.20" +; Information added by Drupal.org packaging script on 2023-01-31 +version = "7.x-1.21" core = "7.x" project = "ctools" -datestamp = "1642577347" +datestamp = "1675152418" diff --git a/html/sites/all/modules/contrib/jquery_update/jquery_update.admin.inc b/html/sites/all/modules/contrib/jquery_update/jquery_update.admin.inc index 8e52f737d..57b948c03 100644 --- a/html/sites/all/modules/contrib/jquery_update/jquery_update.admin.inc +++ b/html/sites/all/modules/contrib/jquery_update/jquery_update.admin.inc @@ -11,8 +11,8 @@ define('JQUERY_UPDATE_EXAMPLE_JQUERY_VERSION', '3.6.1'); define('JQUERY_UPDATE_EXAMPLE_JQUERYUI_VERSION', '1.13.2'); define('JQUERY_UPDATE_EXAMPLE_JQUERY_MIGRATE_VERSION', '3.4.0'); -define('JQUERY_UPDATE_EXAMPLE_JQUERY_COOKIE_VERSION', '4.3.0'); -define('JQUERY_UPDATE_EXAMPLE_JQUERY_FORM_VERSION', '1.4.1'); +define('JQUERY_UPDATE_EXAMPLE_JQUERY_COOKIE_VERSION', '1.4.1'); +define('JQUERY_UPDATE_EXAMPLE_JQUERY_FORM_VERSION', '4.3.0'); /** * Admin settings menu callback. diff --git a/html/sites/all/modules/contrib/jquery_update/jquery_update.info b/html/sites/all/modules/contrib/jquery_update/jquery_update.info index 91d957ec5..4a74fb43e 100644 --- a/html/sites/all/modules/contrib/jquery_update/jquery_update.info +++ b/html/sites/all/modules/contrib/jquery_update/jquery_update.info @@ -5,8 +5,8 @@ core = 7.x files[] = tests/jquery_update.test configure = admin/config/development/jquery_update -; Information added by Drupal.org packaging script on 2022-11-21 -version = "7.x-4.0" +; Information added by Drupal.org packaging script on 2023-02-03 +version = "7.x-4.1" core = "7.x" project = "jquery_update" -datestamp = "1669044750" +datestamp = "1675437626" diff --git a/html/sites/all/modules/contrib/jquery_update/jquery_update.module b/html/sites/all/modules/contrib/jquery_update/jquery_update.module index 535526249..b77976fac 100644 --- a/html/sites/all/modules/contrib/jquery_update/jquery_update.module +++ b/html/sites/all/modules/contrib/jquery_update/jquery_update.module @@ -59,6 +59,16 @@ function jquery_update_library() { ), 'version' => '0.0.1', ); + $libraries['jquery_update.position.fix'] = array( + 'title' => 'jQuery Update Position Fix', + 'js' => array( + drupal_get_path('module', 'jquery_update') . '/js/jquery_position.js' => array( + 'group' => JS_THEME, + 'weight' => 2, + ), + ), + 'version' => '0.0.1', + ); $libraries['jquery.metadata'] = array( 'title' => 'QUnit', 'js' => array( @@ -289,6 +299,7 @@ function jquery_update_jquery_replace(array &$javascript, $cdn, $path, $min, $ve if (!empty($custom_version)) { $javascript['jquery']['version'] = $custom_version; jquery_update_add_jquery_browser_fix($javascript, $custom_version); + jquery_update_add_jquery_position_fix($javascript, $custom_version); } return; } @@ -343,6 +354,7 @@ function jquery_update_jquery_replace(array &$javascript, $cdn, $path, $min, $ve break; } jquery_update_add_jquery_browser_fix($javascript, $version); + jquery_update_add_jquery_position_fix($javascript, $version); } /** @@ -357,6 +369,18 @@ function jquery_update_add_jquery_browser_fix(&$libraries, $jquery_version) { } } +/** + * Add a workaround for .position() behaviour change. + */ +function jquery_update_add_jquery_position_fix(&$libraries, $jquery_version) { + if (version_compare($jquery_version, '3.3', '>=')) { + $libraries['jquery']['dependencies'][] = array( + 'jquery_update', + 'jquery_update.position.fix', + ); + } +} + /** * Add the local fallback in case jQuery from the CDN is unavailable. * diff --git a/html/sites/all/modules/contrib/jquery_update/js/jquery_position.js b/html/sites/all/modules/contrib/jquery_update/js/jquery_position.js new file mode 100644 index 000000000..edf2d105c --- /dev/null +++ b/html/sites/all/modules/contrib/jquery_update/js/jquery_position.js @@ -0,0 +1,34 @@ +/** + * Workaround for .position() behaviour which was changed in jQuery 3.3 + * @see https://github.com/jquery/api.jquery.com/issues/1081 + */ +var Drupal = Drupal || {}; + +(function ($, Drupal) { + // Overload Drupal.jsAC.prototype.populatePopup + if (Drupal.jsAC !== undefined && Drupal.jsAC.prototype.populatePopup !== undefined) { + Drupal.jsAC.prototype.populatePopup = function () { + var $input = $(this.input); + var offset = $input.offset(); + var offsetParent = $input.offsetParent().offset(); + // Show popup. + if (this.popup) { + $(this.popup).remove(); + } + this.selected = false; + this.popup = $('
')[0]; + this.popup.owner = this; + $(this.popup).css({ + top: parseInt(offset.top - offsetParent.top + this.input.offsetHeight, 10) + 'px', + left: parseInt(offset.left - offsetParent.left, 10) + 'px', + width: $input.innerWidth() + 'px', + display: 'none' + }); + $input.before(this.popup); + + // Do search. + this.db.owner = this; + this.db.search(this.input.value); + }; + } +})(jQuery, Drupal); diff --git a/html/sites/all/modules/contrib/jquery_update/tests/jquery_update.test b/html/sites/all/modules/contrib/jquery_update/tests/jquery_update.test index 42d5f7cc8..e1a6b5865 100644 --- a/html/sites/all/modules/contrib/jquery_update/tests/jquery_update.test +++ b/html/sites/all/modules/contrib/jquery_update/tests/jquery_update.test @@ -17,6 +17,20 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { */ private $admin; + /** + * Full admin user for tests. + * + * @var object + */ + private $fullAdmin; + + /** + * Theme admin user for tests. + * + * @var object + */ + private $themeAdmin; + /** * Implements getInfo(). * @@ -49,19 +63,19 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { // n.b. version numbers are arbitrary in most cases here, so probably no // real need update them as new releases come out. $form = array( - 'jquery_update_custom_path_jquery' => "https://code.jquery.com/jquery-3.6.0.js", - 'jquery_update_custom_version_jquery' => "3.6.0", - 'jquery_update_custom_path_jqueryui' => "/sites/default/files/jquery_update/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.13.0", - 'jquery_update_custom_path_cookie' => "/sites/default/files/jquery_update/jquery.cookie.js", - 'jquery_update_custom_version_jquery_cookie' => "1.4.1", - 'jquery_update_custom_path_form' => "/sites/default/files/jquery_update/jquery.form.js", - 'jquery_update_custom_version_jquery_form' => "4.2.1", - 'jquery_update_custom_path_migrate' => "https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js", - 'jquery_update_custom_version_jquery_migrate' => "3.3.2", + 'jquery_update_custom_path_jquery' => 'https://code.jquery.com/jquery-3.6.0.js', + 'jquery_update_custom_version_jquery' => '3.6.0', + 'jquery_update_custom_path_jqueryui' => '/sites/default/files/jquery_update/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.13.0', + 'jquery_update_custom_path_cookie' => '/sites/default/files/jquery_update/jquery.cookie.js', + 'jquery_update_custom_version_jquery_cookie' => '1.4.1', + 'jquery_update_custom_path_form' => '/sites/default/files/jquery_update/jquery.form.js', + 'jquery_update_custom_version_jquery_form' => '4.2.1', + 'jquery_update_custom_path_migrate' => 'https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js', + 'jquery_update_custom_version_jquery_migrate' => '3.3.2', 'jquery_update_jquery_migrate_enable' => TRUE, ); - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); // n.b. a request from an anon user might not see the same script elements. $this->drupalGet('/'); @@ -73,19 +87,19 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { // Test some different local vs. CDN custom paths. $form = array( - 'jquery_update_custom_path_jquery' => "/sites/default/files/jquery_update/jquery.js", - 'jquery_update_custom_version_jquery' => "3.6.0", - 'jquery_update_custom_path_jqueryui' => "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.12.1", - 'jquery_update_custom_path_cookie' => "https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js", - 'jquery_update_custom_version_jquery_cookie' => "1.4.1", - 'jquery_update_custom_path_form' => "https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js", - 'jquery_update_custom_version_jquery_form' => "4.2.1", - 'jquery_update_custom_path_migrate' => "/sites/default/files/jquery_update/jquery-migrate.js", - 'jquery_update_custom_version_jquery_migrate' => "3.3.2", + 'jquery_update_custom_path_jquery' => '/sites/default/files/jquery_update/jquery.js', + 'jquery_update_custom_version_jquery' => '3.6.0', + 'jquery_update_custom_path_jqueryui' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.12.1', + 'jquery_update_custom_path_cookie' => 'https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js', + 'jquery_update_custom_version_jquery_cookie' => '1.4.1', + 'jquery_update_custom_path_form' => 'https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js', + 'jquery_update_custom_version_jquery_form' => '4.2.1', + 'jquery_update_custom_path_migrate' => '/sites/default/files/jquery_update/jquery-migrate.js', + 'jquery_update_custom_version_jquery_migrate' => '3.3.2', 'jquery_update_jquery_migrate_enable' => TRUE, ); - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); $this->drupalGet('/'); $this->assertRaw('', 'Custom jQuery 3.6.0 from local path'); @@ -97,7 +111,7 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { // jQuery browser fix for jQuery >= 1.9 // n.b. the full script tag looks like this in drupalci: // - $this->assertRaw('/jquery_update/js/jquery_browser.js?v=0.0.1">', 'jQuery browser fix 0.0.1'); + $this->assertRaw('jquery_update/js/jquery_browser.js?v=0.0.1">', 'jQuery browser fix 0.0.1'); } /** @@ -106,21 +120,21 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { public function testCustomPathsJsApiExternal() { $form = array( - 'jquery_update_custom_path_jquery' => "https://code.jquery.com/jquery-3.6.1.js", - 'jquery_update_custom_version_jquery' => "3.6.1", - 'jquery_update_custom_path_jqueryui' => "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.13.1", - 'jquery_update_custom_path_cookie' => "https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js", - 'jquery_update_custom_version_jquery_cookie' => "1.4.1", - 'jquery_update_custom_path_form' => "https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js", - 'jquery_update_custom_version_jquery_form' => "4.2.1", - 'jquery_update_custom_path_migrate' => "https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js", - 'jquery_update_custom_version_jquery_migrate' => "3.3.2", + 'jquery_update_custom_path_jquery' => 'https://code.jquery.com/jquery-3.6.1.js', + 'jquery_update_custom_version_jquery' => '3.6.1', + 'jquery_update_custom_path_jqueryui' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.13.1', + 'jquery_update_custom_path_cookie' => 'https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js', + 'jquery_update_custom_version_jquery_cookie' => '1.4.1', + 'jquery_update_custom_path_form' => 'https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js', + 'jquery_update_custom_version_jquery_form' => '4.2.1', + 'jquery_update_custom_path_migrate' => 'https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js', + 'jquery_update_custom_version_jquery_migrate' => '3.3.2', 'jquery_update_jquery_migrate_enable' => TRUE, ); - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); - $js = json_decode($this->drupalGet('/jquery-update-test/drupal-add-js'), TRUE); + $js = json_decode($this->drupalGet('jquery-update-test/drupal-add-js'), TRUE); $keys = preg_grep('/custom_path/', array_keys($form)); foreach ($keys as $custom_path) { $message = format_string('External custom @path set as external', array('@path' => $custom_path)); @@ -134,21 +148,21 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { public function testCustomPathsJsApiRelative() { $form = array( - 'jquery_update_custom_path_jquery' => "/sites/default/files/jquery_update/jquery.js", - 'jquery_update_custom_version_jquery' => "3.6.1", - 'jquery_update_custom_path_jqueryui' => "/sites/default/files/jquery_update/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.13.0", - 'jquery_update_custom_path_cookie' => "/sites/default/files/jquery_update/jquery.cookie.js", - 'jquery_update_custom_version_jquery_cookie' => "1.4.1", - 'jquery_update_custom_path_form' => "/sites/default/files/jquery_update/jquery.form.js", - 'jquery_update_custom_version_jquery_form' => "4.2.1", - 'jquery_update_custom_path_migrate' => "/sites/default/files/jquery_update/jquery-migrate.js", - 'jquery_update_custom_version_jquery_migrate' => "3.3.2", + 'jquery_update_custom_path_jquery' => '/sites/default/files/jquery_update/jquery.js', + 'jquery_update_custom_version_jquery' => '3.6.1', + 'jquery_update_custom_path_jqueryui' => '/sites/default/files/jquery_update/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.13.0', + 'jquery_update_custom_path_cookie' => '/sites/default/files/jquery_update/jquery.cookie.js', + 'jquery_update_custom_version_jquery_cookie' => '1.4.1', + 'jquery_update_custom_path_form' => '/sites/default/files/jquery_update/jquery.form.js', + 'jquery_update_custom_version_jquery_form' => '4.2.1', + 'jquery_update_custom_path_migrate' => '/sites/default/files/jquery_update/jquery-migrate.js', + 'jquery_update_custom_version_jquery_migrate' => '3.3.2', 'jquery_update_jquery_migrate_enable' => TRUE, ); - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); - $js = json_decode($this->drupalGet('/jquery-update-test/drupal-add-js'), TRUE); + $js = json_decode($this->drupalGet('jquery-update-test/drupal-add-js'), TRUE); $keys = preg_grep('/custom_path/', array_keys($form)); foreach ($keys as $custom_path) { $message = format_string('Relative custom @path not set as external', array('@path' => $custom_path)); @@ -185,7 +199,7 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { public function testAvailableUpdates() { // In order to view the Status report. - $this->full_admin = $this->drupalCreateUser(array('administer site configuration')); + $this->fullAdmin = $this->drupalCreateUser(array('administer site configuration')); $info = array( 'jquery_update_latest_version_jquery' => '3.6.1', @@ -199,21 +213,21 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { } $form = array( - 'jquery_update_custom_path_jquery' => "https://code.jquery.com/jquery-3.6.0.js", - 'jquery_update_custom_version_jquery' => "3.6.0", - 'jquery_update_custom_path_jqueryui' => "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.13.1", - 'jquery_update_custom_path_cookie' => "https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js", - 'jquery_update_custom_version_jquery_cookie' => "1.4.1", - 'jquery_update_custom_path_form' => "https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js", - 'jquery_update_custom_version_jquery_form' => "4.2.1", - 'jquery_update_custom_path_migrate' => "https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js", - 'jquery_update_custom_version_jquery_migrate' => "3.3.2", + 'jquery_update_custom_path_jquery' => 'https://code.jquery.com/jquery-3.6.0.js', + 'jquery_update_custom_version_jquery' => '3.6.0', + 'jquery_update_custom_path_jqueryui' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.13.1', + 'jquery_update_custom_path_cookie' => 'https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@1.4.1/jquery.cookie.js', + 'jquery_update_custom_version_jquery_cookie' => '1.4.1', + 'jquery_update_custom_path_form' => 'https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.1/dist/jquery.form.min.js', + 'jquery_update_custom_version_jquery_form' => '4.2.1', + 'jquery_update_custom_path_migrate' => 'https://cdn.jsdelivr.net/npm/jquery-migrate@3.3.2/dist/jquery-migrate.min.js', + 'jquery_update_custom_version_jquery_migrate' => '3.3.2', 'jquery_update_jquery_migrate_enable' => TRUE, ); - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); - $this->drupalGet('/admin/config/development/jquery_update'); + $this->drupalGet('admin/config/development/jquery_update'); $updates = array( 'jquery' => 'An update (3.6.1) is available for the current custom version (3.6.0) of the jquery library.', @@ -231,8 +245,8 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { $this->assertNoRaw('is available for the current custom version (1.4.1) of the jquery-cookie library.'); - $this->drupalLogin($this->full_admin); - $this->drupalGet('/admin/reports/status'); + $this->drupalLogin($this->fullAdmin); + $this->drupalGet('admin/reports/status'); $this->assertRaw('Updates are available for at least one library managed by jQuery Update', 'Available updates message shown on status report'); $this->assertRaw('jquery, jqueryui, jquery-migrate, jquery.form'); $this->assertRaw('WarningjQuery Update library updates available', 'Status report shows a warning for available updates'); @@ -241,7 +255,7 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { variable_set('jquery_update_warning_available_update', FALSE); $this->drupalLogin($this->admin); - $this->drupalGet('/admin/config/development/jquery_update'); + $this->drupalGet('admin/config/development/jquery_update'); foreach ($updates as $library => $update) { // drupal_set_message warnings. $this->assertNoRaw('
  • ' . $update . '
  • ', format_string('No warning message showing update available for $%library', array('%library' => $library))); @@ -249,8 +263,8 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { $this->assertRaw('' . $update . '', format_string('Info showing update available for $%library', array('%library' => $library))); } - $this->drupalLogin($this->full_admin); - $this->drupalGet('/admin/reports/status'); + $this->drupalLogin($this->fullAdmin); + $this->drupalGet('admin/reports/status'); $this->assertRaw('Updates are available for at least one library managed by jQuery Update', 'Available updates message shown on status report'); $this->assertRaw('jquery, jqueryui, jquery-migrate, jquery.form'); $this->assertNoRaw('WarningjQuery Update library updates available', 'Status report shows a warning for available updates'); @@ -277,7 +291,7 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { } $this->assertTrue(in_array($libraries['jquery']['js']['misc/jquery.js']['data'], $supported_versions), 'Obsolete jQuery version was replaced by the default one.'); - $js = json_decode($this->drupalGet('/jquery-update-test/drupal-add-js'), TRUE); + $js = json_decode($this->drupalGet('jquery-update-test/drupal-add-js'), TRUE); $this->assertTrue(array_key_exists($libraries['jquery']['js']['misc/jquery.js']['data'], $js), 'Obsolete jQuery version was rendered correctly.'); $url = file_create_url($libraries['jquery']['js']['misc/jquery.js']['data']); $this->drupalHead($url); @@ -289,7 +303,25 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { */ public function testExampleCustomPaths() { - $this->drupalGet('/admin/config/development/jquery_update'); + // Disable get latest. + variable_set('jquery_update_check_latest_versions', FALSE); + + // These are arbitrary values just for testing. + $info = array( + 'jquery_update_latest_version_jquery' => '1.2.3', + 'jquery_update_latest_version_jqueryui' => '2.3.4', + 'jquery_update_latest_version_jquery_migrate' => '3.4.5', + 'jquery_update_latest_version_jquery_cookie' => '4.5.6', + 'jquery_update_latest_version_jquery_form' => '5.6.7', + ); + + // Reset to default values. + foreach ($info as $k => $v) { + variable_del($k); + } + + // Test default values. + $this->drupalGet('admin/config/development/jquery_update'); $this->assertRaw('Example: https://code.jquery.com/jquery-3.6.1.js or', 'Default example jquery custom path'); $this->assertRaw('Example: 3.6.1', 'Default example jquery custom version'); $this->assertRaw('Example: https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js or', 'Default example jqueryui custom path'); @@ -301,19 +333,13 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { $this->assertRaw('Example: https://cdn.jsdelivr.net/gh/jquery-form/form@4.3.0/dist/jquery.form.min.js or', 'Default example jquery.form custom path'); $this->assertRaw('Example: 4.3.0', 'Default example jquery.form custom version'); - // These are arbitrary values just for testing. - $info = array( - 'jquery_update_latest_version_jquery' => '1.2.3', - 'jquery_update_latest_version_jqueryui' => '2.3.4', - 'jquery_update_latest_version_jquery_migrate' => '3.4.5', - 'jquery_update_latest_version_jquery_cookie' => '4.5.6', - 'jquery_update_latest_version_jquery_form' => '5.6.7', - ); + // Set custom values. foreach ($info as $k => $v) { variable_set($k, $v); } - $this->drupalGet('/admin/config/development/jquery_update'); + // Test custom values. + $this->drupalGet('admin/config/development/jquery_update'); $this->assertRaw('Example: https://code.jquery.com/jquery-1.2.3.js or', 'Updated example jquery custom path'); $this->assertRaw('Example: 1.2.3', 'Updated example jquery custom version'); $this->assertRaw('Example: https://cdnjs.cloudflare.com/ajax/libs/jqueryui/2.3.4/jquery-ui.min.js or', 'Updated example jqueryui custom path'); @@ -332,22 +358,22 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { */ public function testMultipleVersions() { - $this->full_admin = $this->drupalCreateUser( + $this->fullAdmin = $this->drupalCreateUser( array( 'administer site configuration', 'administer themes', 'administer jquery update', ) ); - $this->drupalLogin($this->full_admin); + $this->drupalLogin($this->fullAdmin); $form = array( - 'jquery_update_custom_path_jquery' => "https://code.jquery.com/jquery-3.6.1.js", - 'jquery_update_custom_version_jquery' => "3.6.1", + 'jquery_update_custom_path_jquery' => 'https://code.jquery.com/jquery-3.6.1.js', + 'jquery_update_custom_version_jquery' => '3.6.1', ); $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); $form = array( - 'jquery_update_jquery_version' => "1.12", + 'jquery_update_jquery_version' => '1.12', ); $this->drupalPost('admin/appearance/settings/seven', $form, t('Save configuration')); @@ -364,14 +390,14 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { // This time also set up a custom jQuery UI version. $form = array( - 'jquery_update_custom_path_jquery' => "https://code.jquery.com/jquery-3.6.1.js", - 'jquery_update_custom_version_jquery' => "3.6.1", - 'jquery_update_custom_path_jqueryui' => "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js", - 'jquery_update_custom_version_jqueryui' => "1.13.1", + 'jquery_update_custom_path_jquery' => 'https://code.jquery.com/jquery-3.6.1.js', + 'jquery_update_custom_version_jquery' => '3.6.1', + 'jquery_update_custom_path_jqueryui' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.1/jquery-ui.min.js', + 'jquery_update_custom_version_jqueryui' => '1.13.1', ); $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); $form = array( - 'jquery_update_jquery_version' => "2.2", + 'jquery_update_jquery_version' => '2.2', ); $this->drupalPost('admin/appearance/settings/seven', $form, t('Save configuration')); @@ -392,14 +418,18 @@ class JqueryUpdateTestCase extends DrupalWebTestCase { */ public function testAjaxPageStateVersion() { // Use jQuery 2.2 from the module for default and admin themes. - $theme_admin = $this->drupalCreateUser(array( + $this->themeAdmin = $this->drupalCreateUser(array( 'administer jquery update', 'administer themes', )); - $this->drupalLogin($theme_admin); - $form['jquery_update_jquery_version'] = '2.2'; - $this->drupalPost('/admin/config/development/jquery_update', $form, t('Save configuration')); + $this->drupalLogin($this->themeAdmin); + + $form = array( + 'jquery_update_jquery_version' => '2.2', + ); + $this->drupalPost('admin/config/development/jquery_update', $form, t('Save configuration')); $this->drupalPost('admin/appearance/settings/seven', $form, t('Save configuration')); + drupal_static_reset('drupal_get_library'); $libraries = drupal_get_library('system'); $this->assertEqual('2.2.4', $libraries['jquery']['version'], 'Configured version 2.2.4 before library alter.'); diff --git a/html/sites/all/modules/contrib/jquery_update/tests/jquery_update_test.info b/html/sites/all/modules/contrib/jquery_update/tests/jquery_update_test.info index f8fdf7e50..00b237b51 100644 --- a/html/sites/all/modules/contrib/jquery_update/tests/jquery_update_test.info +++ b/html/sites/all/modules/contrib/jquery_update/tests/jquery_update_test.info @@ -4,8 +4,8 @@ package = Testing core = 7.x hidden = TRUE -; Information added by Drupal.org packaging script on 2022-11-21 -version = "7.x-4.0" +; Information added by Drupal.org packaging script on 2023-02-03 +version = "7.x-4.1" core = "7.x" project = "jquery_update" -datestamp = "1669044750" +datestamp = "1675437626" diff --git a/html/sites/all/modules/contrib/linkchecker/README.txt b/html/sites/all/modules/contrib/linkchecker/README.txt index 96c733be9..08ddbce97 100644 --- a/html/sites/all/modules/contrib/linkchecker/README.txt +++ b/html/sites/all/modules/contrib/linkchecker/README.txt @@ -22,8 +22,8 @@ activity under Reports -> Recent log messages. Required: 1. For internal URL extraction you need to make sure that Cron always get called - with your real public site URL (for e.g. http://example.com/cron.php). Make - sure it's never executed with http://localhost/cron.php or any other + with your real public site URL (for e.g. https://example.com/cron.php). Make + sure it's never executed with https://localhost/cron.php or any other hostnames or ports, not available from public. Otherwise all links may be reported as broken and cannot verified as they should be. diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.admin.inc b/html/sites/all/modules/contrib/linkchecker/linkchecker.admin.inc index 7ee74c599..d9aeb09ff 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.admin.inc +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.admin.inc @@ -112,7 +112,7 @@ function linkchecker_admin_settings_form($form_state) { $form['check'] = array( '#type' => 'fieldset', '#title' => t('Check settings'), - '#description' => t('For simultaneous link checks it is recommended to install the HTTP Parallel Request & Threading Library. This may be necessary on larger sites with very many links (30.000+), but will also improve overall link check duration on smaller sites. Currently the site has @count links (@count_enabled enabled / @count_disabled disabled).', array('@httprl' => 'http://drupal.org/project/httprl', '@count' => $count_lids_enabled+$count_lids_disabled, '@count_enabled' => $count_lids_enabled, '@count_disabled' => $count_lids_disabled)), + '#description' => t('For simultaneous link checks it is recommended to install the HTTP Parallel Request & Threading Library. This may be necessary on larger sites with very many links (30.000+), but will also improve overall link check duration on smaller sites. Currently the site has @count links (@count_enabled enabled / @count_disabled disabled).', array('@httprl' => 'https://drupal.org/project/httprl', '@count' => $count_lids_enabled+$count_lids_disabled, '@count_enabled' => $count_lids_enabled, '@count_disabled' => $count_lids_disabled)), '#collapsible' => FALSE, ); $form['check']['linkchecker_check_library'] = array( @@ -162,7 +162,7 @@ function linkchecker_admin_settings_form($form_state) { '#default_value' => variable_get('linkchecker_disable_link_check_for_urls', LINKCHECKER_RESERVED_DOCUMENTATION_DOMAINS), '#type' => 'textarea', '#title' => t('Do not check the link status of links containing these URLs'), - '#description' => t('By default this list contains the domain names reserved for use in documentation and not available for registration. See RFC 2606, Section 3 for more information. URLs on this list are still extracted, but the link setting Check link status becomes automatically disabled to prevent false alarms. If you change this list you need to clear all link data and re-analyze your content. Otherwise this setting will only affect new links added after the configuration change.', array('@rfc-2606' => 'http://www.rfc-editor.org/rfc/rfc2606.txt')), + '#description' => t('By default this list contains the domain names reserved for use in documentation and not available for registration. See RFC 2606, Section 3 for more information. URLs on this list are still extracted, but the link setting Check link status becomes automatically disabled to prevent false alarms. If you change this list you need to clear all link data and re-analyze your content. Otherwise this setting will only affect new links added after the configuration change.', array('@rfc-2606' => 'https://www.rfc-editor.org/rfc/rfc2606.txt')), ); $form['check']['linkchecker_log_level'] = array( '#default_value' => variable_get('linkchecker_log_level', WATCHDOG_INFO), diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.info b/html/sites/all/modules/contrib/linkchecker/linkchecker.info index 8c5db0cb7..093729d0b 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.info +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.info @@ -5,8 +5,8 @@ core = 7.x files[] = linkchecker.drush.inc files[] = linkchecker.test -; Information added by Drupal.org packaging script on 2018-08-19 -version = "7.x-1.4" +; Information added by Drupal.org packaging script on 2023-01-23 +version = "7.x-1.5" core = "7.x" project = "linkchecker" -datestamp = "1534714685" +datestamp = "1674441219" diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.install b/html/sites/all/modules/contrib/linkchecker/linkchecker.install index 14587a5dd..cc58b6d64 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.install +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.install @@ -354,12 +354,12 @@ function linkchecker_update_7006() { function linkchecker_update_7007() { // Available D7 filters (12/30/2011): // - // - Line break converter, http://drupal.org/project/drupal + // - Line break converter, https://drupal.org/project/drupal // name: filter_autop (D6: filter/1) - // - Insert block, http://drupal.org/project/insert_block + // - Insert block, https://drupal.org/project/insert_block // name: insert_block (D6 insert_block/0) // tags: [block:name of module=delta of block] - // - Insert view filter, http://drupal.org/project/insert_view + // - Insert view filter, https://drupal.org/project/insert_view // name: insert_view (D6: insert_view/0) // See core filter_update_7003(); diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.module b/html/sites/all/modules/contrib/linkchecker/linkchecker.module index ee5344431..7c5c1ff75 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.module +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.module @@ -4,7 +4,7 @@ * @file * This module periodically check links in given node types, blocks etc. * - * Developed by Alexander Hass, http://www.yaml-for-drupal.com/. + * Developed by Alexander Hass, https://www.yaml-for-drupal.com/. */ /** @@ -24,34 +24,34 @@ define('LINKCHECKER_RESERVED_DOCUMENTATION_DOMAINS', "example.com\nexample.net\n * extraction process. This filters only eat processing time or holds references * to other nodes. * - * - Line break converter, http://drupal.org/project/drupal + * - Line break converter, https://drupal.org/project/drupal * name: filter_autop - * - Insert block, http://drupal.org/project/insert_block + * - Insert block, https://drupal.org/project/insert_block * name: insert_block * tags: [block:name of module=delta of block] - * - Insert view filter, http://drupal.org/project/insert_view + * - Insert view filter, https://drupal.org/project/insert_view * name: insert_view * tags: [view:my_view] - * - Smiley filter, http://drupal.org/project/smiley + * - Smiley filter, https://drupal.org/project/smiley * name: smiley * tags: Depends on icon set, for e.g: ":) :-) :smile:" - * - Web Links Embed, http://drupal.org/project/weblinks + * - Web Links Embed, https://drupal.org/project/weblinks * name: weblinks_embed * tags: [links-embed: id], [links-embed: name] - * - Web Links Filter, http://drupal.org/project/weblinks + * - Web Links Filter, https://drupal.org/project/weblinks * name: weblinks_filter * tags: [link: title] * * @todo - * - Smileys Filter, http://drupal.org/project/smileys + * - Smileys Filter, https://drupal.org/project/smileys * name: smileys * tags: Depends on icon set, for e.g: ":) :-) :smile:" - * - Insert node, http://drupal.org/project/InsertNode + * - Insert node, https://drupal.org/project/InsertNode * name: insert_node/0 * tags: [node: ] - * - Weblink filter, http://drupal.org/project/links + * - Weblink filter, https://drupal.org/project/links * name: links_weblink/0 - * tags: [weblink:node_id|text], [weblink:node_id/link_id], [weblink:http://weblink.example.com/] + * tags: [weblink:node_id|text], [weblink:node_id/link_id], [weblink:https://weblink.example.com/] */ define('LINKCHECKER_DEFAULT_FILTER_BLACKLIST', 'filter_autop|insert_block|insert_view|smiley|smileys|weblinks_embed|weblinks_filter'); @@ -85,7 +85,7 @@ function linkchecker_permission() { function linkchecker_help($path, $arg) { switch ($path) { case 'admin/help#linkchecker': - return '

    ' . t('This module provides an aid to finding broken links on your site. It periodically checks contents of all public nodes, tries to find any html links and check for their validity. It reports broken links through the admin interface. For more information about status codes see Status Code Definitions.', array('@rfc' => 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html')) . '

    '; + return '

    ' . t('This module provides an aid to finding broken links on your site. It periodically checks contents of all public nodes, tries to find any html links and check for their validity. It reports broken links through the admin interface. For more information about status codes see Status Code Definitions.', array('@rfc' => 'https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html')) . '

    '; } } @@ -167,7 +167,7 @@ function linkchecker_admin_paths() { * translate. * @param $severity * The severity of the message; one of the following values as defined in - * @link http://www.faqs.org/rfcs/rfc3164.html RFC 3164: @endlink + * @link https://www.faqs.org/rfcs/rfc3164.html RFC 3164: @endlink * - WATCHDOG_EMERGENCY: Emergency, system is unusable. * - WATCHDOG_ALERT: Alert, action must be taken immediately. * - WATCHDOG_CRITICAL: Critical conditions. @@ -233,7 +233,7 @@ function _linkchecker_user_access_edit_link_settings($link) { */ function _linkchecker_link_access($link) { $link = (object) $link; - return _linkchecker_link_node_ids($link) || _linkchecker_link_comment_ids($link) || _linkchecker_link_block_ids($link); + return (_linkchecker_link_node_ids($link) !== FALSE) || (_linkchecker_link_comment_ids($link) !== FALSE) || (_linkchecker_link_block_ids($link) !== FALSE); } /** @@ -256,17 +256,20 @@ function _linkchecker_link_access($link) { * additionally be restricted to only those owned by this account. Otherwise, * nodes owned by any user account may be returned. * - * @return array + * @return array|bool * An array of node IDs that contain the provided link and that the current - * user may be allowed to view. + * user may be allowed to view, or FALSE if they are not allowed access. */ function _linkchecker_link_node_ids($link, $node_author_account = NULL) { static $fields_with_node_links = array(); // Exit if all node types are disabled or if the user cannot access content, // there is no need to check further. + if (!user_access('access content')) { + return FALSE; + } $linkchecker_scan_nodetypes = linkchecker_scan_node_types(); - if (empty($linkchecker_scan_nodetypes) || !user_access('access content')) { + if (empty($linkchecker_scan_nodetypes)) { return array(); } @@ -362,15 +365,18 @@ function _linkchecker_link_node_ids($link, $node_author_account = NULL) { * will additionally be restricted to only those owned by this account. * Otherwise, comments owned by any user account may be returned. * - * @return array + * @return array|bool * An array of comment IDs that contain the provided link and that the - * current user is allowed to view. + * current user is allowed to view, or FALSE if they are not allowed access. */ function _linkchecker_link_comment_ids($link, $comment_author_account = NULL) { // Exit if comments are disabled or if the user cannot access comments, there // is no need to check further. + if (!user_access('access comments')) { + return FALSE; + } $comment_types = linkchecker_scan_comment_types(); - if (empty($comment_types) || !user_access('access comments')) { + if (empty($comment_types)) { return array(); } @@ -406,9 +412,9 @@ function _linkchecker_link_comment_ids($link, $comment_author_account = NULL) { * @param object $link * An object representing the link to check. * - * @return array + * @return array|bool * An array of custom block IDs that contain the provided link and that the - * current user is allowed to view. + * current user is allowed to view, or FALSE if they are not allowed access. */ function _linkchecker_link_block_ids($link) { // Exit if blocks are disabled. @@ -441,7 +447,13 @@ function _linkchecker_link_block_ids($link) { $query->distinct(); $allowed_bids = $query->execute()->fetchCol(); - return array_intersect($bids, $allowed_bids); + $results = array_intersect($bids, $allowed_bids); + if ((!empty($bids) && empty($allowed_bids)) || (!empty($allowed_bids) && empty($results))) { + return FALSE; + } + else { + return $results; + } } /** @@ -500,7 +512,7 @@ function _linkchecker_check_links() { $linkchecker_check_useragent = variable_get('linkchecker_check_useragent', 'Drupal (+http://drupal.org/)'); // Connection limit can be overridden via settings.php. Two connections is the - // limit defined in RFC http://www.ietf.org/rfc/rfc2616.txt. Modern browsers + // limit defined in RFC https://www.ietf.org/rfc/rfc2616.txt. Modern browsers // are typically using 6-8 connections and no more. Never use more and keep // in mind that you can overload other people servers. $linkchecker_check_domain_connections = variable_get('linkchecker_check_domain_connections', 2); @@ -604,7 +616,7 @@ function _linkchecker_status_handling(&$response, $link) { // - Prevent E_ALL warnings in DB updates for non-existing $response->error. // - @todo drupal_http_request() may not provide an UTF8 encoded error message // what results in a database UPDATE failure. For more information, see - // http://drupal.org/node/371495. + // https://drupal.org/node/371495. // Workaround: ISO-8859-1 as source encoding may be wrong, but WFM. if (!isset($response->error)) { $response->error = ''; @@ -620,10 +632,10 @@ function _linkchecker_status_handling(&$response, $link) { // - or by any other element (naming with the id attribute) // - and must not contain a key/value pair as these type of hash fragments are // typically used by AJAX applications to prevent additionally HTTP requests - // e.g. http://www.example.com/ajax.html#key1=value1&key2=value2 + // e.g. https://www.example.com/ajax.html#key1=value1&key2=value2 // - and must not contain '/' or ',' as this are not normal anchors. // - and '#top' is a reserved fragment that must not exist in a page. - // See http://www.w3.org/TR/html401/struct/links.html + // See https://www.w3.org/TR/html401/struct/links.html if ($response->code == 200 && !empty($response->data) && !empty($response->headers['content-type']) @@ -671,7 +683,7 @@ function _linkchecker_status_handling(&$response, $link) { $result = db_query('SELECT nid FROM {linkchecker_node} WHERE lid = :lid', array(':lid' => $link->lid)); foreach ($result as $row) { // Explicitly don't use node_load_multiple() or the module may run - // into issues like http://drupal.org/node/1210606. With this logic + // into issues like https://drupal.org/node/1210606. With this logic // nodes can be updated until an out of memory occurs and further // updates will be made on the remaining nodes only. $node = node_load($row->nid); @@ -708,7 +720,7 @@ function _linkchecker_status_handling(&$response, $link) { $result = db_query('SELECT cid FROM {linkchecker_comment} WHERE lid = :lid', array(':lid' => $link->lid)); foreach ($result as $row) { // Explicitly don't use comment_load_multiple() or the module may run - // into issues like http://drupal.org/node/1210606. With this logic + // into issues like https://drupal.org/node/1210606. With this logic // comment can be updated until an out of memory occurs and further // updates will be made on the remaining comments only. $comment = comment_load($row->cid); @@ -1106,6 +1118,33 @@ function linkchecker_form_comment_form_alter(&$form, &$form_state, $form_id) { } } +/** + * Implements hook_form_FORM_ID_alter(). + */ +function linkchecker_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) { + $linkchecker_excludes = variable_get('linkchecker_exclude'); + $form['field']['linkchecker_exclude'] = array ( + '#type' => 'checkbox', + '#title' => t('Exclude field from Link Checker scans'), + '#description' => t('Force Link Checker to ignore this field when scanning content for broken links.'), + '#default_value' => $linkchecker_excludes[$form['#field']['field_name']] ? $linkchecker_excludes[$form['#field']['field_name']] : 0, + ); + $form['#submit'][] = 'linkchecker_form_field_ui_field_edit_form_submit'; +} + + +/** + * Custom submit handler for field edit page. + */ +function linkchecker_form_field_ui_field_edit_form_submit($form, &$form_state) { + $linkchecker_excludes = variable_get('linkchecker_exclude'); + if (!isset($linkchecker_excludes)) { + variable_set('linkchecker_exclude', array()); + } + $linkchecker_excludes[$form['#field']['field_name']] = $form['field']['linkchecker_exclude']['#value'] ; + variable_set('linkchecker_exclude', $linkchecker_excludes); +} + /** * Custom submit handler for block add page. */ @@ -1194,6 +1233,15 @@ function _linkchecker_extract_node_links($node, $return_field_names = FALSE) { // found earlier while looping over $text_items_by_field below. $text_items_by_field = array_merge($text_items_by_field, _linkchecker_parse_fields('node', $node->type, $node, TRUE)); $text_items_by_field['title'][] = _filter_url($node->title, $filter); + // Filter out the fields that are to be ignored. + $linkchecker_excludes = variable_get('linkchecker_exclude'); + if (isset($linkchecker_excludes)) { + foreach ($linkchecker_excludes as $field => $value) { + if ($value == 1) { + unset($text_items_by_field[$field]); + } + } + } $text_items = _linkchecker_array_values_recursive($text_items_by_field); // Get the absolute node path for extraction of relative links. @@ -1761,7 +1809,7 @@ function _linkchecker_parse_fields($entity_type, $bundle_name, $entity, $return_ } break; - // Link module field, http://drupal.org/project/link. + // Link module field, https://drupal.org/project/link. case 'link_field': foreach ($entity_field as $language) { foreach ($language as $item) { @@ -1823,7 +1871,7 @@ function _linkchecker_replace_fields($entity_type, $bundle_name, $entity, $old_u } break; - // Link module field, http://drupal.org/project/link. + // Link module field, https://drupal.org/project/link. case 'link_field': foreach ($entity_field as $language_name => $language_value) { foreach ($language_value as $item_name => $item_value) { @@ -2082,7 +2130,7 @@ function _linkchecker_extract_links($text = '', $content_path = NULL) { // This logic intentionally does not implement all the rules definied in // RFC 3986, section 5.2.4 to show broken links and over-dot-segmented // URIs; e.g., http://example.com/../../foo/bar. - // For more information, see http://drupal.org/node/832388. + // For more information, see https://drupal.org/node/832388. $path = substr_replace($absolute_content_path . $url_decoded, '', 0, strlen($base_root)); // Remove './' segments where possible. @@ -2322,7 +2370,7 @@ function _linkchecker_link_replace(&$text, $old_link_fqdn = '', $new_link_fqdn = /** * Customized clone of core check_markup() with additional filter blacklist. * - * See http://api.drupal.org/api/function/check_markup/7 for API documentation. + * See https://api.drupal.org/api/function/check_markup/7 for API documentation. */ function _linkchecker_check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE) { if (!isset($text)) { @@ -2554,7 +2602,7 @@ function _linkchecker_unpublish_nodes($lid) { $result = db_query('SELECT nid FROM {linkchecker_node} WHERE lid = :lid', array(':lid' => $lid)); foreach ($result as $row) { // Explicitly don't use node_load_multiple() or the module may run - // into issues like http://drupal.org/node/1210606. With this logic + // into issues like https://drupal.org/node/1210606. With this logic // nodes can be updated until an out of memory occurs and further // updates will be made on the remaining nodes only. $node = node_load($row->nid); @@ -2577,7 +2625,7 @@ function linkchecker_link_load($lid) { } /** - * Impersonates another user, see http://drupal.org/node/287292#comment-3162350. + * Impersonates another user, see https://drupal.org/node/287292#comment-3162350. * * Each time this function is called, the active user is saved and $new_user * becomes the active user. Multiple calls to this function can be nested, @@ -2657,9 +2705,9 @@ function _linkchecker_isdefaultrevision($entity) { // // This behaviour will change in D8 where $node->isDefaultRevision has been // introduced. See below links for more details. - // - http://drupal.org/node/1879482 - // - http://drupal.org/node/218755 - // - http://drupal.org/node/1522154 + // - https://drupal.org/node/1879482 + // - https://drupal.org/node/218755 + // - https://drupal.org/node/1522154 // // Every moderation module saving a forward revision needs to return FALSE. // @todo: Refactor this workaround under D8. diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.pages.inc b/html/sites/all/modules/contrib/linkchecker/linkchecker.pages.inc index 7bc16f8f0..e818a0a24 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.pages.inc +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.pages.inc @@ -155,7 +155,7 @@ function _linkchecker_report_page($query, $account = NULL) { // display it, for reasons explained in _linkchecker_link_access(). We // still need to fill the table row, though, so as not to throw off the // number of items in the pager. - if (empty($nids) && empty($cids) && empty($bids)) { + if ($nids === FALSE && $cids === FALSE && $bids === FALSE) { $rows[] = array(array('data' => t('Permission restrictions deny you access to this broken link.'), 'colspan' => count($header))); continue; } @@ -167,23 +167,28 @@ function _linkchecker_report_page($query, $account = NULL) { $links[] = l(t('Edit link settings'), 'linkchecker/' . $link->lid . '/edit', array('query' => drupal_get_destination())); } - // Show link to nodes having this broken link. - foreach ($nids as $nid) { - $links[] = l(t('Edit node @node', array('@node' => $nid)), 'node/' . $nid . '/edit', array('query' => drupal_get_destination())); + if (empty($nids) && empty($cids) && empty($bids)) { + $links[] = t('This link was not found in any content.'); } + else { + // Show link to nodes having this broken link. + foreach ($nids as $nid) { + $links[] = l(t('Edit node @node', array('@node' => $nid)), 'node/' . $nid . '/edit', array('query' => drupal_get_destination())); + } - // Show link to comments having this broken link. - $comment_types = linkchecker_scan_comment_types(); - if (module_exists('comment') && !empty($comment_types)) { - foreach ($cids as $cid) { - $links[] = l(t('Edit comment @comment', array('@comment' => $cid)), 'comment/' . $cid . '/edit', array('query' => drupal_get_destination())); + // Show link to comments having this broken link. + $comment_types = linkchecker_scan_comment_types(); + if (module_exists('comment') && !empty($comment_types)) { + foreach ($cids as $cid) { + $links[] = l(t('Edit comment @comment', array('@comment' => $cid)), 'comment/' . $cid . '/edit', array('query' => drupal_get_destination())); + } } - } - // Show link to blocks having this broken link. - if ($access_administer_blocks) { - foreach ($bids as $bid) { - $links[] = l(t('Edit block @block', array('@block' => $bid)), 'admin/structure/block/manage/block/' . $bid . '/configure', array('query' => drupal_get_destination())); + // Show link to blocks having this broken link. + if ($access_administer_blocks) { + foreach ($bids as $bid) { + $links[] = l(t('Edit block @block', array('@block' => $bid)), 'admin/structure/block/manage/block/' . $bid . '/configure', array('query' => drupal_get_destination())); + } } } diff --git a/html/sites/all/modules/contrib/linkchecker/linkchecker.test b/html/sites/all/modules/contrib/linkchecker/linkchecker.test index a9244c1fd..7fc433e35 100644 --- a/html/sites/all/modules/contrib/linkchecker/linkchecker.test +++ b/html/sites/all/modules/contrib/linkchecker/linkchecker.test @@ -72,7 +72,7 @@ class LinkCheckerLinkExtractionTest extends DrupalWebTestCase { ./foo4/./foo5/foo6 ./test/foo bar/is_valid-hack.test - + URL with uncommon chars URL with space URL with ajax query params diff --git a/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.info b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.info new file mode 100644 index 000000000..6b42d6d72 --- /dev/null +++ b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.info @@ -0,0 +1,14 @@ +name = Link checker Bean +description = "Periodically checks for broken links in beans and reports the results." +configure = admin/config/content/linkchecker +package = "Link checker" +core = 7.x + +dependencies[] = bean +dependencies[] = linkchecker + +; Information added by Drupal.org packaging script on 2023-01-23 +version = "7.x-1.5" +core = "7.x" +project = "linkchecker" +datestamp = "1674441219" diff --git a/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.install b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.install new file mode 100644 index 000000000..8ae794047 --- /dev/null +++ b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.install @@ -0,0 +1,53 @@ + 'Stores all link references for beans.', + 'fields' => array( + 'bid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique {bean}.bid.', + ), + 'lid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique {linkchecker_link}.lid.', + ), + ), + 'primary key' => array('bid', 'lid'), + 'foreign keys' => array( + 'bid' => array('bean' => 'bid'), + 'lid' => array('linkchecker_link' => 'lid'), + ), + 'indexes' => array('lid' => array('lid')), + ); + + return $schema; +} + +/** + * If the core modules are disabled the integration need to be disabled. + */ +function linkchecker_bean_modules_disabled($modules) { + // Disable link checks for bean. + if (in_array('bean', $modules)) { + variable_set('linkchecker_scan_beans', 0); + drupal_set_message(t('Link checks for beans have been disabled.')); + } +} diff --git a/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.module b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.module new file mode 100644 index 000000000..43841523d --- /dev/null +++ b/html/sites/all/modules/contrib/linkchecker/modules/linkchecker_bean/linkchecker_bean.module @@ -0,0 +1,445 @@ + $bean_type) { + $bean_names[$type] = $bean_type->getLabel(); + } + $form['settings']['linkchecker_scan_beans'] = array( + '#type' => 'checkboxes', + '#prefix' => "
    ", + '#title' => t('Scan beans for links'), + '#default_value' => variable_get('linkchecker_scan_beans', array()), + '#options' => array_map('check_plain', $bean_names), + '#description' => t('Enable link checking for the selected bean type(s).'), + ); + $form['settings']['linkchecker_check_links_types']['#weight'] = 10; + + $form['#submit'][] = 'linkchecker_bean_admin_settings_form_submit'; + + $form['clear']['linkchecker_analyze']['#submit'][] = 'linkchecker_bean_analyze_links_submit'; + $form['clear']['linkchecker_clear_analyze']['#submit'][] = 'linkchecker_bean_clear_analyze_links_submit'; +} + +/** + * Submit callback. + * + * Analyze fields in all beans. + */ +function linkchecker_bean_analyze_links_submit($form, &$form_state) { + if (variable_get('linkchecker_scan_beans', 0)) { + batch_set(_linkchecker_bean_batch_import_beans()); + } +} + +/** + * Submit callback. + * + * Clear link data and analyze fields in all bean types. + */ +function linkchecker_bean_clear_analyze_links_submit($form, &$form_state) { + db_truncate('linkchecker_bean')->execute(); + + if (variable_get('linkchecker_scan_beans', 0)) { + batch_set(_linkchecker_bean_batch_import_beans()); + } +} + + +/** + * Linkchecker admin_settings_form submit handler. + */ +function linkchecker_bean_admin_settings_form_submit($form, &$form_state) { + // If beans scanning has been selected. + if ($form_state['values']['linkchecker_scan_beans'] > $form['settings']['linkchecker_scan_beans']['#default_value']) { + batch_set(_linkchecker_bean_batch_import_beans()); + } +} + + +/** + * Batch: Scan beans for links. + */ +function _linkchecker_bean_batch_import_beans() { + $bean_types = array_keys(array_filter(variable_get('linkchecker_scan_beans', array()))); + $query = db_select('bean', 'b') + ->fields('b', array('bid')) + ->orderBy('b.bid') + ->condition('b.type', $bean_types); + $result = $query->execute()->fetchAll(); + + $operations = array(); + foreach ($result as $row) { + $operations[] = array('_linkchecker_bean_batch_beans_import_op', array($row->bid)); + } + $batch = array( + 'finished' => '_linkchecker_bean_batch_beans_import_finished', + 'operations' => $operations, + 'title' => t('Scanning for links'), + ); + + return $batch; +} + +/** + * Batch operation: Scan one by one bean for links. + */ +function _linkchecker_bean_batch_beans_import_op($bid, &$context) { + // Load the bean and scan for links. + $bean = bean_load($bid); + _linkchecker_bean_add_bean_links($bean); + + // Store results for post-processing in the finished callback. + $context['results'][] = $bean->bid; + $context['message'] = t('Bean: @title', array('@title' => $bean->title)); +} + +/** + * Implements hook_entity_insert(). + */ +function linkchecker_bean_entity_insert($entity, $type) { + if ($type == 'bean') { + if (_linkchecker_bean_scan_bean_types($entity->type)) { + _linkchecker_bean_add_bean_links($entity); + } + } +} + +/** + * Implements hook_entity_update(). + */ +function linkchecker_bean_entity_update($entity, $type) { + if ($type == 'bean') { + if (_linkchecker_bean_scan_bean_types($entity->type)) { + _linkchecker_bean_add_bean_links($entity); + } + } +} + + +/** + * Implements hook_entity_delete(). + */ +function linkchecker_bean_entity_delete($entity, $type) { + if ($type == 'bean') { + if (_linkchecker_bean_scan_bean_types($entity->type)) { + _linkchecker_bean_delete_bean_links($entity->bid); + } + } +} + +/** + * Add bean links to database. + * + * @param object $bean + * The fully populated bean object. + * @param bool $skip_missing_links_detection + * To prevent endless batch loops the value need to be TRUE. With FALSE + * the need for content re-scans is detected by the number of missing links. + */ +function _linkchecker_bean_add_bean_links($bean, $skip_missing_links_detection = FALSE) { + + $filter = new stdClass(); + $filter->settings['filter_url_length'] = 72; + + // Create array of bean fields to scan. + $text_items = array(); + if (!empty($bean->label)) { + $text_items[] = _filter_url($bean->label, $filter); + } + if (!empty($bean->title)) { + $text_items[] = _filter_url($bean->title, $filter); + } + $text_items = array_merge( + $text_items, + _linkchecker_parse_fields('bean', $bean->type, $bean) + ); + + // Get the absolute ban path for extraction of relative links. + $path = url('block/' . $bean->delta, array('absolute' => TRUE)); + + // Extract all links in bean. + $links = array_keys(_linkchecker_extract_links(implode(' ', $text_items), $path)); + + // Taxonomy have links. + if (!empty($links)) { + // Remove all links from the links array already in the database and only + // add missing links to database. + $missing_links = _linkchecker_bean_links_missing($bean->bid, $links); + + // Only add unique links to database that do not exist. + $i = 0; + foreach ($missing_links as $url) { + $urlhash = drupal_hash_base64($url); + $link = db_query('SELECT lid FROM {linkchecker_link} WHERE urlhash = :urlhash', array(':urlhash' => $urlhash))->fetchObject(); + if (!$link) { + $link = new stdClass(); + $link->urlhash = $urlhash; + $link->url = $url; + $link->status = _linkchecker_link_check_status_filter($url); + drupal_write_record('linkchecker_link', $link); + } + db_insert('linkchecker_bean') + ->fields(array( + 'bid' => $bean->bid, + 'lid' => $link->lid, + )) + ->execute(); + + // Break processing if max links limit per run has been reached. + $i++; + if ($i >= LINKCHECKER_SCAN_MAX_LINKS_PER_RUN) { + break; + } + } + + // The first chunk of links not yet found in the {linkchecker_link} table + // have now been imported by the above code. If the number of missing links + // still exceeds the scan limit defined in LINKCHECKER_SCAN_MAX_LINKS_PER_RUN + // the content need to be re-scanned until all links have been collected and + // saved in {linkchecker_link} table. + // + // Above code has already scanned a number of LINKCHECKER_SCAN_MAX_LINKS_PER_RUN + // links and need to be substracted from the number of missing links to + // calculate the correct number of re-scan rounds. + // + // To prevent endless loops the $skip_missing_links_detection need to be TRUE. + // This value will be set by the calling batch process that already knows + // that it is running a batch job and the number of required re-scan rounds. + $missing_links_count = count($missing_links) - LINKCHECKER_SCAN_MAX_LINKS_PER_RUN; + if (!$skip_missing_links_detection && $missing_links_count > 0) { + batch_set(_linkchecker_bean_batch_import_single_bean($bean->bid, $missing_links_count)); + + // If batches were set in the submit handlers, we process them now, + // possibly ending execution. We make sure we do not react to the batch + // that is already being processed (if a batch operation performs a + // drupal_execute). + if ($batch = &batch_get() && !isset($batch['current_set'])) { + batch_process('block/' . $bean->type); + } + } + } + + // Remove dead link references for cleanup reasons as very last step. + _linkchecker_bean_cleanup_bean_references($bean->bid, $links); +} + +/** + * Should the defined bean type scanned for links? + * + * @param string $bean_type + * Verifies if the bean_type is enabled for link checks and should be scanned. + * + * @return bool + * TRUE if bean type should be scanned, otherwise FALSE. + */ +function _linkchecker_bean_scan_bean_types($bean_type = NULL) { + + $enabled = FALSE; + $bean_types = array_keys(array_filter(variable_get('linkchecker_scan_beans', array()))); + + // Scan specific bean types only. + if (in_array($bean_type, $bean_types)) { + $enabled = TRUE; + } + + return $enabled; +} + +/** + * Cleanup no longer used bean references to links in the linkchecker_bean table. + */ +function _linkchecker_bean_cleanup_bean_references($bid = 0, $links = array()) { + if (empty($links)) { + // Term do not have links. Delete all references if exists. + db_delete('linkchecker_bean') + ->condition('bid', $bid) + ->execute(); + } + else { + // The bean still have more than one link, but other links may have been + // removed and links no longer in the content need to be deleted from the + // linkchecker_bean reference table. + $subquery = db_select('linkchecker_link') + ->fields('linkchecker_link', array('lid')) + ->condition('urlhash', array_map('drupal_hash_base64', $links), 'IN'); + + db_delete('linkchecker_bean') + ->condition('bid', $bid) + ->condition('lid', $subquery, 'NOT IN') + ->execute(); + } +} + +/** + * Returns an array of bean references missing in the linkchecker_bean table. + */ +function _linkchecker_bean_links_missing($bid, $links) { + $result = db_query('SELECT ll.url FROM {linkchecker_link} ll INNER JOIN {linkchecker_bean} lb ON lb.lid = ll.lid WHERE lb.bid = :bid AND ll.urlhash IN (:urlhashes)', array(':bid' => $bid, ':urlhashes' => array_map('drupal_hash_base64', $links))); + $links_in_database = array(); + foreach ($result as $row) { + $links_in_database[] = $row->url; + } + return array_diff($links, $links_in_database); +} + +/** + * Remove all bean references to links in the linkchecker_bean table. + */ +function _linkchecker_bean_delete_bean_links($bid) { + db_delete('linkchecker_bean') + ->condition('bid', $bid) + ->execute(); +} + +/** + * Recurring scans of a single bean via batch API. + * + * @param int $bid + * The unique bean id to scan for links. + * @param int $missing_links_count + * The number of links not yet added to linkchecker_links table. By this + * number the re-scan rounds are calulated. + * + * @return array + * The batch task definition. + */ +function _linkchecker_bean_batch_import_single_bean($bid, $missing_links_count) { + $operations = array(); + for ($i = 0; $i <= $missing_links_count; $i = $i + (int) LINKCHECKER_SCAN_MAX_LINKS_PER_RUN) { + $operations[] = array('_linkchecker_bean_batch_beans_import_op', array($bid)); + } + $batch = array( + 'file' => drupal_get_path('module', 'linkchecker') . '/linkchecker.batch.inc', + 'finished' => '_linkchecker_bean_batch_beans_import_finished', + 'operations' => $operations, + 'title' => t('Scanning for links'), + 'progress_message' => t('Remaining @remaining of @total scans.'), + ); + + return $batch; +} + +/** + * Output bean batch result messages. + * + * @param bool $success + * If scan completed successfully or not. + * @param int $results + * Number of beans scanned. + * @param array $operations + * Array of functions called. + */ +function _linkchecker_bean_batch_beans_import_finished($success, $results, $operations) { + if ($success) { + $message = format_plural(count($results), 'One bean has been scanned.', '@count beans have been scanned.'); + } + else { + $message = t('Scanning for links in beans have failed with an error.'); + } + drupal_set_message($message); +} + +/** + * Returns IDs of bans that contain a link which the current user is allowed to view. + * + * @param object $link + * An object representing the link to check. + * @return array + * An array of bean IDs that contain the provided link and that the + * current user is allowed to view. + */ +function linkchecker_bean_link_beans_ids($link) { + // Exit if beans are disabled. + if (!variable_get('linkchecker_scan_beans', 0)) { + return array(); + } + + // Get a list of beans containing the link. + $query = db_select('bean', 'b'); + $query->addMetaData('base_table', 'bean'); + $query->innerJoin('linkchecker_bean', 'lb', 'lb.bid = b.bid'); + $query->condition('lb.lid', $link->lid); + $query->fields('b', array('bid')); + $bids = $query->execute()->fetchCol(); + + // Return the array of bean IDs. + if ($bids) { + return $bids; + } + return array(); +} + +/** + * Implements hook_linkchecker_bean_linkchecker_auto_repair_301_links_alter(). + */ +function linkchecker_bean_linkchecker_auto_repair_301_links_alter($link, $response) { +// TAXONOMY: Autorepair all beans having this outdated link. + $result = db_query('SELECT bid FROM {linkchecker_bean} WHERE lid = :lid', array(':lid' => $link->lid)); + foreach ($result as $row) { + + $bean = bean_load($row->bid); + + // Has the bean object loaded successfully? + if (is_object($bean)) { + $bean_original = clone $bean; + + // Replace links in title. + _linkchecker_link_replace($bean->title, $link->url, $response->redirect_url); + + // Replace links in fields. + $bean = _linkchecker_replace_fields('bean', $bean->type, $bean, $link->url, $response->redirect_url); + + // Save changed bean and update the bean link list. + if ($bean_original != $bean) { + bean_save($bean); + watchdog('linkchecker', 'Changed permanently moved link in bean %bean from %src to %dst.', array('%bean' => $bean->bid, '%src' => $link->url, '%dst' => $response->redirect_url), WATCHDOG_INFO); + } + else { + watchdog('linkchecker', 'Link update in bean failed. Permanently moved link %src not found in bean %bean. Manual fix required.', array('%bead' => $bean->bid, '%src' => $link->url), WATCHDOG_WARNING); + } + } + else { + watchdog('linkchecker', 'Loading bean %bean for update failed. Manual fix required.', array('%bean' => $bean->bid), WATCHDOG_ERROR); + } + } +} + +/** + * Implements hook_linkcheker_main_table(). + */ +function linkchecker_bean_linkcheker_main_table() { + return array('linkchecker_bean'); +} + +/** + * Implements hook_linkchecker_report_page_links_alter(). + */ +function linkchecker_bean_linkchecker_report_page_links_alter(&$links, $link) { + $bids = module_invoke('linkchecker_bean', 'linkchecker_link_ids', $link); + if ($bids) { + $beans = bean_load_multiple($bids); + // Show link to beans having this broken link. + if (variable_get('linkchecker_scan_beans', 0) && !empty($beans)) { + foreach ($beans as $bean) { + $links[] = l(t('Edit bean @bean', array('@bean' => $bean->bid)), 'block/' . $bean->delta . '/edit', array('query' => drupal_get_destination())); + } + } + } +} + +/** + * Implements hook_linkchecker_link_ids(). + */ +function linkchecker_bean_linkchecker_link_ids($link) { + return linkchecker_bean_link_beans_ids($link); +} \ No newline at end of file diff --git a/html/sites/all/modules/contrib/user_expire/PATCHES.txt b/html/sites/all/modules/contrib/user_expire/PATCHES.txt index fee89159f..d0c75570e 100644 --- a/html/sites/all/modules/contrib/user_expire/PATCHES.txt +++ b/html/sites/all/modules/contrib/user_expire/PATCHES.txt @@ -2,7 +2,7 @@ This file was automatically generated by Composer Patches (https://github.com/cw Patches applied to this directory: If a user is activated, deactivated by the module, and reactivated by an admin, reset their expiration period -Source: https://git.drupalcode.org/project/user_expire/-/merge_requests/8.diff +Source: PATCHES/user-expire-reset-activation-period.patch OPS-8147: Customise the expiry email text diff --git a/html/sites/all/themes/ocha_basic/package-lock.json b/html/sites/all/themes/ocha_basic/package-lock.json index 29321c341..780972612 100644 --- a/html/sites/all/themes/ocha_basic/package-lock.json +++ b/html/sites/all/themes/ocha_basic/package-lock.json @@ -5728,9 +5728,9 @@ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-errors": { "version": "1.7.3", @@ -17844,9 +17844,9 @@ } }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "http-errors": { "version": "1.7.3", diff --git a/html/sites/all/themes/radix/kits/default/yarn.lock b/html/sites/all/themes/radix/kits/default/yarn.lock index 18ff02e35..8185be748 100644 --- a/html/sites/all/themes/radix/kits/default/yarn.lock +++ b/html/sites/all/themes/radix/kits/default/yarn.lock @@ -2202,8 +2202,8 @@ is-unc-path@^0.1.1: unc-path-regex "^0.1.0" is-url@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.2.tgz#498905a593bf47cc2d9e7f738372bbf7696c7f26" + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" is-utf8@^0.2.0: version "0.2.1" diff --git a/html/sites/all/themes/radix/yarn.lock b/html/sites/all/themes/radix/yarn.lock index 18ff02e35..8185be748 100644 --- a/html/sites/all/themes/radix/yarn.lock +++ b/html/sites/all/themes/radix/yarn.lock @@ -2202,8 +2202,8 @@ is-unc-path@^0.1.1: unc-path-regex "^0.1.0" is-url@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.2.tgz#498905a593bf47cc2d9e7f738372bbf7696c7f26" + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" is-utf8@^0.2.0: version "0.2.1"