diff --git a/composer.json b/composer.json index 3ab95dc2ff9c9b6f80e8984f67e3b6ea39052d75..1527bdbb9a90e0ca0a582109aa18a60500cddea2 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "desandro/masonry": "4.2", "dimsemenov/magnific-popup": "1.1", "drupal/addtocalendar": "3.2", - "drupal/admin_toolbar": "3.0.2", + "drupal/admin_toolbar": "3.0.3", "drupal/administerusersbyrole": "3.0", "drupal/allowed_formats": "1.3", "drupal/anchor_link": "1.7", @@ -155,13 +155,13 @@ "drupal/search_api_db": "1.19", "drupal/simple_gmap": "3.0.1", "drupal/simple_instagram_feed": "^3.11", - "drupal/simple_sitemap": "3.10", + "drupal/simple_sitemap": "3.11", "drupal/simplesamlphp_auth": "3.2", "drupal/smtp": "1.0", "drupal/social_media": "1.9-rc2", "drupal/social_media_links": "^2.8", "drupal/superfish": "1.4", - "drupal/svg_image": "1.14", + "drupal/svg_image": "1.15", "drupal/token": "1.9", "drupal/twig_tweak": "2.9", "drupal/twitter_block": "3.0-alpha1", @@ -174,7 +174,7 @@ "drupal/views_bootstrap": "3.6", "drupal/views_bulk_operations": "3.13", "drupal/views_fieldsets": "^3.4", - "drupal/views_infinite_scroll": "1.8", + "drupal/views_infinite_scroll": "1.9", "drupal/webform": "^6", "drush-ops/behat-drush-endpoint": "0.0.5", "drush/drush": "10.3.6", diff --git a/composer.lock b/composer.lock index 2e4118d494a5620e6f190fdca6e12d06fffbe3aa..2b1cfb3365254a7fca488b4da653b27ccf70deef 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dee17df1727a8fa0b885fa33c86cafba", + "content-hash": "cc02b294136709d94b7f71af1ce79139", "packages": [ { "name": "alchemy/zippy", @@ -1710,17 +1710,17 @@ }, { "name": "drupal/admin_toolbar", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://git.drupalcode.org/project/admin_toolbar.git", - "reference": "3.0.2" + "reference": "3.0.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.0.2.zip", - "reference": "3.0.2", - "shasum": "a3b7a8030695d0c1d49ec57786321e2dd142184a" + "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.0.3.zip", + "reference": "3.0.3", + "shasum": "ce735c931c0bd6da79bd8e45ca459d61015bbe44" }, "require": { "drupal/core": "^8.8.0 || ^9.0" @@ -1731,8 +1731,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "3.0.2", - "datestamp": "1629907124", + "version": "3.0.3", + "datestamp": "1632322497", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2602,12 +2602,12 @@ ], "authors": [ { - "name": "jhodgdon", - "homepage": "https://www.drupal.org/user/155601" + "name": "Pasqualle", + "homepage": "https://www.drupal.org/user/80733" }, { - "name": "nedjo", - "homepage": "https://www.drupal.org/user/4481" + "name": "codebymikey", + "homepage": "https://www.drupal.org/user/3573206" } ], "description": "Provides basic revert and update functionality for other modules", @@ -3794,6 +3794,10 @@ "name": "Berdir", "homepage": "https://www.drupal.org/user/214652" }, + { + "name": "TR", + "homepage": "https://www.drupal.org/user/202830" + }, { "name": "bojanz", "homepage": "https://www.drupal.org/user/86106" @@ -4603,6 +4607,10 @@ "homepage": "https://www.drupal.org/user/213194", "email": "geerlingguy@mac.com" }, + { + "name": "TR", + "homepage": "https://www.drupal.org/user/202830" + }, { "name": "geerlingguy", "homepage": "https://www.drupal.org/user/389011" @@ -4692,6 +4700,10 @@ "name": "oknate", "homepage": "https://www.drupal.org/user/471638" }, + { + "name": "ram4nd", + "homepage": "https://www.drupal.org/user/601534" + }, { "name": "rszrama", "homepage": "https://www.drupal.org/user/49344" @@ -5094,7 +5106,7 @@ "extra": { "drupal": { "version": "8.x-5.0-beta13", - "datestamp": "1632933670", + "datestamp": "1632946970", "security-coverage": { "status": "not-covered", "message": "Beta releases are not covered by Drupal security advisories." @@ -6013,8 +6025,8 @@ "homepage": "https://www.drupal.org/user/93254" }, { - "name": "Fabianx", - "homepage": "https://www.drupal.org/user/693738" + "name": "greg.1.anderson", + "homepage": "https://www.drupal.org/user/438598" }, { "name": "stevector", @@ -6734,10 +6746,6 @@ "GPL-2.0-or-later" ], "authors": [ - { - "name": "jhodgdon", - "homepage": "https://www.drupal.org/user/155601" - }, { "name": "martin107", "homepage": "https://www.drupal.org/user/2659379" @@ -6799,17 +6807,17 @@ }, { "name": "drupal/simple_sitemap", - "version": "3.10.0", + "version": "3.11.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/simple_sitemap.git", - "reference": "8.x-3.10" + "reference": "8.x-3.11" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/simple_sitemap-8.x-3.10.zip", - "reference": "8.x-3.10", - "shasum": "4836e5d5bae0b4348406c832f81eabfaf16483e3" + "url": "https://ftp.drupal.org/files/projects/simple_sitemap-8.x-3.11.zip", + "reference": "8.x-3.11", + "shasum": "5fdd4ed5af5e37e3c707e401d094a179f52e7711" }, "require": { "drupal/core": "^8 || ^9", @@ -6818,8 +6826,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-3.10", - "datestamp": "1617840662", + "version": "8.x-3.11", + "datestamp": "1634344305", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6837,9 +6845,9 @@ ], "authors": [ { - "name": "Pawel Ginalski (gbyte.co)", - "homepage": "https://www.drupal.org/u/gbyte.co", - "email": "contact@gbyte.co", + "name": "Pawel Ginalski (gbyte)", + "homepage": "https://www.drupal.org/u/gbyte", + "email": "contact@gbyte.dev", "role": "Maintainer" }, { @@ -7149,17 +7157,17 @@ }, { "name": "drupal/svg_image", - "version": "1.14.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/svg_image.git", - "reference": "8.x-1.14" + "reference": "8.x-1.15" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/svg_image-8.x-1.14.zip", - "reference": "8.x-1.14", - "shasum": "0a6ca8104995a8cf4a1fff3e9e04e1fecf734b11" + "url": "https://ftp.drupal.org/files/projects/svg_image-8.x-1.15.zip", + "reference": "8.x-1.15", + "shasum": "368d0189bb3c59ea40cf52d83c8551b6358aa161" }, "require": { "drupal/core": "^8 || ^9", @@ -7168,8 +7176,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.14", - "datestamp": "1591251834", + "version": "8.x-1.15", + "datestamp": "1629259130", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7924,17 +7932,17 @@ }, { "name": "drupal/views_infinite_scroll", - "version": "1.8.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/views_infinite_scroll.git", - "reference": "8.x-1.8" + "reference": "8.x-1.9" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.8.zip", - "reference": "8.x-1.8", - "shasum": "b9fceb24184792fb81c4e2ff1bf7f18fd8e50674" + "url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.9.zip", + "reference": "8.x-1.9", + "shasum": "875d58d317d48036ed1d9ef538bc8a76bc3dcb5b" }, "require": { "drupal/core": "^8.8 || ^9" @@ -7942,8 +7950,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.8", - "datestamp": "1615218916", + "version": "8.x-1.9", + "datestamp": "1632421809", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -8335,25 +8343,26 @@ }, { "name": "enshrined/svg-sanitize", - "version": "0.13.3", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "bc66593f255b7d2613d8f22041180036979b6403" + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/bc66593f255b7d2613d8f22041180036979b6403", - "reference": "bc66593f255b7d2613d8f22041180036979b6403", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/307b42066fb0b76b5119f5e1f0826e18fefabe95", + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95", "shasum": "" }, "require": { "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "php": "^7.0 || ^8.0" }, "require-dev": { "codeclimate/php-test-reporter": "^0.1.2", - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^6.5 || ^8.5" }, "type": "library", "autoload": { @@ -8374,9 +8383,9 @@ "description": "An SVG sanitizer for PHP", "support": { "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/develop" + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.1" }, - "time": "2020-01-20T01:34:17+00:00" + "time": "2021-08-09T23:46:54+00:00" }, { "name": "enyo/dropzone", @@ -10892,6 +10901,7 @@ "issues": "https://github.com/simplesamlphp/simplesamlphp-module-authfacebook/issues", "source": "https://github.com/simplesamlphp/simplesamlphp-module-authfacebook" }, + "abandoned": true, "time": "2020-03-13T11:29:21+00:00" }, { @@ -11050,6 +11060,7 @@ "issues": "https://github.com/tvdijen/simplesamlphp-module-authwindowslive/issues", "source": "https://github.com/tvdijen/simplesamlphp-module-authwindowslive" }, + "abandoned": true, "time": "2019-12-03T09:01:13+00:00" }, { @@ -11830,6 +11841,7 @@ "issues": "https://github.com/simplesamlphp/simplesamlphp-module-oauth/issues", "source": "https://github.com/simplesamlphp/simplesamlphp-module-oauth/" }, + "abandoned": true, "time": "2020-04-29T19:37:43+00:00" }, { @@ -15525,6 +15537,7 @@ "issues": "https://github.com/webmozart/path-util/issues", "source": "https://github.com/webmozart/path-util/tree/2.3.0" }, + "abandoned": "symfony/filesystem", "time": "2015-12-17T08:42:14+00:00" }, { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c3d3fbae53f5db3b3205afd9251efd7cf7131e8f..a9f9416c4bd90b4ffe8de5a0877f5c7f3f32e249 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1751,18 +1751,18 @@ }, { "name": "drupal/admin_toolbar", - "version": "3.0.2", - "version_normalized": "3.0.2.0", + "version": "3.0.3", + "version_normalized": "3.0.3.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/admin_toolbar.git", - "reference": "3.0.2" + "reference": "3.0.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.0.2.zip", - "reference": "3.0.2", - "shasum": "a3b7a8030695d0c1d49ec57786321e2dd142184a" + "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.0.3.zip", + "reference": "3.0.3", + "shasum": "ce735c931c0bd6da79bd8e45ca459d61015bbe44" }, "require": { "drupal/core": "^8.8.0 || ^9.0" @@ -1773,8 +1773,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "3.0.2", - "datestamp": "1629907124", + "version": "3.0.3", + "datestamp": "1632322497", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7068,18 +7068,18 @@ }, { "name": "drupal/simple_sitemap", - "version": "3.10.0", - "version_normalized": "3.10.0.0", + "version": "3.11.0", + "version_normalized": "3.11.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/simple_sitemap.git", - "reference": "8.x-3.10" + "reference": "8.x-3.11" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/simple_sitemap-8.x-3.10.zip", - "reference": "8.x-3.10", - "shasum": "4836e5d5bae0b4348406c832f81eabfaf16483e3" + "url": "https://ftp.drupal.org/files/projects/simple_sitemap-8.x-3.11.zip", + "reference": "8.x-3.11", + "shasum": "5fdd4ed5af5e37e3c707e401d094a179f52e7711" }, "require": { "drupal/core": "^8 || ^9", @@ -7088,8 +7088,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-3.10", - "datestamp": "1617840662", + "version": "8.x-3.11", + "datestamp": "1634344305", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7108,9 +7108,9 @@ ], "authors": [ { - "name": "Pawel Ginalski (gbyte.co)", - "homepage": "https://www.drupal.org/u/gbyte.co", - "email": "contact@gbyte.co", + "name": "Pawel Ginalski (gbyte)", + "homepage": "https://www.drupal.org/u/gbyte", + "email": "contact@gbyte.dev", "role": "Maintainer" }, { @@ -7439,18 +7439,18 @@ }, { "name": "drupal/svg_image", - "version": "1.14.0", - "version_normalized": "1.14.0.0", + "version": "1.15.0", + "version_normalized": "1.15.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/svg_image.git", - "reference": "8.x-1.14" + "reference": "8.x-1.15" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/svg_image-8.x-1.14.zip", - "reference": "8.x-1.14", - "shasum": "0a6ca8104995a8cf4a1fff3e9e04e1fecf734b11" + "url": "https://ftp.drupal.org/files/projects/svg_image-8.x-1.15.zip", + "reference": "8.x-1.15", + "shasum": "368d0189bb3c59ea40cf52d83c8551b6358aa161" }, "require": { "drupal/core": "^8 || ^9", @@ -7459,8 +7459,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.14", - "datestamp": "1591251834", + "version": "8.x-1.15", + "datestamp": "1629259130", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -8256,18 +8256,18 @@ }, { "name": "drupal/views_infinite_scroll", - "version": "1.8.0", - "version_normalized": "1.8.0.0", + "version": "1.9.0", + "version_normalized": "1.9.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/views_infinite_scroll.git", - "reference": "8.x-1.8" + "reference": "8.x-1.9" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.8.zip", - "reference": "8.x-1.8", - "shasum": "b9fceb24184792fb81c4e2ff1bf7f18fd8e50674" + "url": "https://ftp.drupal.org/files/projects/views_infinite_scroll-8.x-1.9.zip", + "reference": "8.x-1.9", + "shasum": "875d58d317d48036ed1d9ef538bc8a76bc3dcb5b" }, "require": { "drupal/core": "^8.8 || ^9" @@ -8275,8 +8275,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.8", - "datestamp": "1614959012", + "version": "8.x-1.9", + "datestamp": "1632421809", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -8678,28 +8678,29 @@ }, { "name": "enshrined/svg-sanitize", - "version": "0.13.3", - "version_normalized": "0.13.3.0", + "version": "0.14.1", + "version_normalized": "0.14.1.0", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "bc66593f255b7d2613d8f22041180036979b6403" + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/bc66593f255b7d2613d8f22041180036979b6403", - "reference": "bc66593f255b7d2613d8f22041180036979b6403", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/307b42066fb0b76b5119f5e1f0826e18fefabe95", + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95", "shasum": "" }, "require": { "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "php": "^7.0 || ^8.0" }, "require-dev": { "codeclimate/php-test-reporter": "^0.1.2", - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^6.5 || ^8.5" }, - "time": "2020-01-20T01:34:17+00:00", + "time": "2021-08-09T23:46:54+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -8718,6 +8719,10 @@ } ], "description": "An SVG sanitizer for PHP", + "support": { + "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.1" + }, "install-path": "../enshrined/svg-sanitize" }, { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index ddc65fc6a3bbd8b9aa0b61b9f468a5381a77d3f8..d48d5dc534c39d097a249da772493f6115c587e8 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'df61ac4c80357a6ff9e6e56957f55630f42d3212', + 'reference' => '8c95cc1428a6a5a5cff6253e55885e0657ef7fd8', 'name' => 'osu-asc-webservices/d8-upstream', 'dev' => true, ), @@ -284,12 +284,12 @@ 'dev_requirement' => false, ), 'drupal/admin_toolbar' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/admin_toolbar', 'aliases' => array(), - 'reference' => '3.0.2', + 'reference' => '3.0.3', 'dev_requirement' => false, ), 'drupal/administerusersbyrole' => array( @@ -1568,12 +1568,12 @@ 'dev_requirement' => false, ), 'drupal/simple_sitemap' => array( - 'pretty_version' => '3.10.0', - 'version' => '3.10.0.0', + 'pretty_version' => '3.11.0', + 'version' => '3.11.0.0', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/simple_sitemap', 'aliases' => array(), - 'reference' => '8.x-3.10', + 'reference' => '8.x-3.11', 'dev_requirement' => false, ), 'drupal/simplesamlphp_auth' => array( @@ -1640,12 +1640,12 @@ 'dev_requirement' => false, ), 'drupal/svg_image' => array( - 'pretty_version' => '1.14.0', - 'version' => '1.14.0.0', + 'pretty_version' => '1.15.0', + 'version' => '1.15.0.0', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/svg_image', 'aliases' => array(), - 'reference' => '8.x-1.14', + 'reference' => '8.x-1.15', 'dev_requirement' => false, ), 'drupal/syslog' => array( @@ -1823,12 +1823,12 @@ 'dev_requirement' => false, ), 'drupal/views_infinite_scroll' => array( - 'pretty_version' => '1.8.0', - 'version' => '1.8.0.0', + 'pretty_version' => '1.9.0', + 'version' => '1.9.0.0', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/views_infinite_scroll', 'aliases' => array(), - 'reference' => '8.x-1.8', + 'reference' => '8.x-1.9', 'dev_requirement' => false, ), 'drupal/views_ui' => array( @@ -1886,12 +1886,12 @@ 'dev_requirement' => false, ), 'enshrined/svg-sanitize' => array( - 'pretty_version' => '0.13.3', - 'version' => '0.13.3.0', + 'pretty_version' => '0.14.1', + 'version' => '0.14.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../enshrined/svg-sanitize', 'aliases' => array(), - 'reference' => 'bc66593f255b7d2613d8f22041180036979b6403', + 'reference' => '307b42066fb0b76b5119f5e1f0826e18fefabe95', 'dev_requirement' => false, ), 'enyo/dropzone' => array( @@ -2104,7 +2104,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'df61ac4c80357a6ff9e6e56957f55630f42d3212', + 'reference' => '8c95cc1428a6a5a5cff6253e55885e0657ef7fd8', 'dev_requirement' => false, ), 'pantheon-systems/quicksilver-pushback' => array( diff --git a/vendor/enshrined/svg-sanitize/.github/workflows/tests.yml b/vendor/enshrined/svg-sanitize/.github/workflows/tests.yml new file mode 100644 index 0000000000000000000000000000000000000000..323c154d2f6b2adbb010274b2e828e56068d2185 --- /dev/null +++ b/vendor/enshrined/svg-sanitize/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + + - name: Validate composer.json and composer.lock + run: composer validate + +# - name: Lint PHP +# uses: overtrue/phplint@7.4 +# with: +# path: . +# options: --exclude=vendor + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: composer run-script test diff --git a/vendor/enshrined/svg-sanitize/.gitignore b/vendor/enshrined/svg-sanitize/.gitignore index ccee11c594d4f23b11459c461a68a26d8d6c7e14..1c48129f854d3719551a23d464440f121d00cd57 100644 --- a/vendor/enshrined/svg-sanitize/.gitignore +++ b/vendor/enshrined/svg-sanitize/.gitignore @@ -1,4 +1,5 @@ /vendor /build /.idea -composer.lock \ No newline at end of file +/.phpunit.result.cache +composer.lock diff --git a/vendor/enshrined/svg-sanitize/composer.json b/vendor/enshrined/svg-sanitize/composer.json index ed475560e3850871e2f2005621e759c1aa4044d8..8253fdcfb665234ac10c971b739c7b68f8b38368 100644 --- a/vendor/enshrined/svg-sanitize/composer.json +++ b/vendor/enshrined/svg-sanitize/composer.json @@ -8,6 +8,9 @@ "email": "daryll@enshrined.co.uk" } ], + "scripts": { + "test": "phpunit --no-coverage" + }, "autoload": { "psr-4": { "enshrined\\svgSanitize\\": "src" @@ -18,13 +21,13 @@ "enshrined\\svgSanitize\\Tests\\": "tests" } }, - "minimum-stability": "stable", "require": { "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "php": "^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6", + "phpunit/phpunit": "^6.5 || ^8.5", "codeclimate/php-test-reporter": "^0.1.2" } } diff --git a/vendor/enshrined/svg-sanitize/phpunit.xml b/vendor/enshrined/svg-sanitize/phpunit.xml index d6a4a062eea87a39d31af517a3253d05536c0b12..c406b238843e28cdfe8a3d924463f561afeea055 100644 --- a/vendor/enshrined/svg-sanitize/phpunit.xml +++ b/vendor/enshrined/svg-sanitize/phpunit.xml @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit bootstrap="vendor/autoload.php" colors="true" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> <testsuites> <testsuite name="The project's test suite"> @@ -19,4 +18,4 @@ <directory suffix=".php">./src</directory> </whitelist> </filter> -</phpunit> \ No newline at end of file +</phpunit> diff --git a/vendor/enshrined/svg-sanitize/src/Sanitizer.php b/vendor/enshrined/svg-sanitize/src/Sanitizer.php index 16f562facd770262ce77d2c93cb96e5562e2c1b6..58c8111848d4dd4cb1770c2afe54ce814faef490 100644 --- a/vendor/enshrined/svg-sanitize/src/Sanitizer.php +++ b/vendor/enshrined/svg-sanitize/src/Sanitizer.php @@ -208,8 +208,6 @@ public function sanitize($dirty) return false; } - $this->removeDoctype(); - // Pre-process all identified elements $xPath = new XPath($this->xmlDocument); $this->elementReferenceResolver = new Resolver($xPath, $this->useNestingLimit); @@ -219,6 +217,8 @@ public function sanitize($dirty) // Grab all the elements $allElements = $this->xmlDocument->getElementsByTagName("*"); + // remove doctype after node elements have been analyzed + $this->removeDoctype(); // Start the cleaning proccess $this->startClean($allElements, $elementsToRemove); @@ -245,8 +245,12 @@ public function sanitize($dirty) */ protected function setUpBefore() { - // Turn off the entity loader - $this->xmlLoaderValue = libxml_disable_entity_loader(true); + // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is + // disabled by default, so this function is no longer needed to protect against XXE attacks. + if (\LIBXML_VERSION < 20900) { + // Turn off the entity loader + $this->xmlLoaderValue = libxml_disable_entity_loader(true); + } // Suppress the errors because we don't really have to worry about formation before cleansing libxml_use_internal_errors(true); @@ -260,8 +264,12 @@ protected function setUpBefore() */ protected function resetAfter() { - // Reset the entity loader - libxml_disable_entity_loader($this->xmlLoaderValue); + // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is + // disabled by default, so this function is no longer needed to protect against XXE attacks. + if (\LIBXML_VERSION < 20900) { + // Reset the entity loader + libxml_disable_entity_loader($this->xmlLoaderValue); + } } /** @@ -435,6 +443,11 @@ protected function cleanHrefs(\DOMElement $element) */ protected function isHrefSafeValue($value) { + // Allow empty values + if (empty($value)) { + return true; + } + // Allow fragment identifiers. if ('#' === substr($value, 0, 1)) { return true; diff --git a/vendor/enshrined/svg-sanitize/src/svg-scanner.php b/vendor/enshrined/svg-sanitize/src/svg-scanner.php index 0da242f8c7c2f0b88835b81ec13643741a6ff8ef..e5007713c660b82656168036069dad800e1259d6 100644 --- a/vendor/enshrined/svg-sanitize/src/svg-scanner.php +++ b/vendor/enshrined/svg-sanitize/src/svg-scanner.php @@ -12,9 +12,14 @@ require_once( __DIR__ . '/data/TagInterface.php' ); require_once( __DIR__ . '/data/AllowedAttributes.php' ); require_once( __DIR__ . '/data/AllowedTags.php' ); +require_once( __DIR__ . '/data/XPath.php' ); +require_once( __DIR__ . '/ElementReference/Resolver.php' ); +require_once( __DIR__ . '/ElementReference/Subject.php' ); +require_once( __DIR__ . '/ElementReference/Usage.php' ); +require_once( __DIR__ . '/Exceptions/NestingException.php' ); +require_once( __DIR__ . '/Helper.php' ); require_once( __DIR__ . '/Sanitizer.php' ); - /* * Print array as JSON and then * exit program with a particular diff --git a/vendor/enshrined/svg-sanitize/tests/AllowedAttributesTest.php b/vendor/enshrined/svg-sanitize/tests/AllowedAttributesTest.php index 16423be60fd305347aaa97c49d63936f493a12ac..a3ed8905b90f87c4c358fe1866b39bf24aa8694c 100644 --- a/vendor/enshrined/svg-sanitize/tests/AllowedAttributesTest.php +++ b/vendor/enshrined/svg-sanitize/tests/AllowedAttributesTest.php @@ -9,26 +9,13 @@ */ class AllowedAttributesTest extends TestCase { - - /** - * @var AllowedAttributes - */ - protected $class; - - /** - * Set up the test class - */ - public function setUp() - { - $this->class = new AllowedAttributes(); - } - /** * Test that the class implements the interface */ public function testItImplementsTheInterface() { - $this->assertInstanceOf('enshrined\svgSanitize\data\AttributeInterface', $this->class); + $class = new AllowedAttributes(); + self::assertInstanceOf('enshrined\svgSanitize\data\AttributeInterface', $class); } /** @@ -37,7 +24,6 @@ public function testItImplementsTheInterface() public function testThatItReturnsAnArray() { $result = AllowedAttributes::getAttributes(); - - $this->assertInternalType('array', $result); + self::assertSame('array', gettype($result)); } -} \ No newline at end of file +} diff --git a/vendor/enshrined/svg-sanitize/tests/AllowedTagsTest.php b/vendor/enshrined/svg-sanitize/tests/AllowedTagsTest.php index 111eefb3325709238943d333f9f2d146ebe71026..2bc3e8c70b43b7b4b661447640fc98e4e09f3dae 100644 --- a/vendor/enshrined/svg-sanitize/tests/AllowedTagsTest.php +++ b/vendor/enshrined/svg-sanitize/tests/AllowedTagsTest.php @@ -9,26 +9,13 @@ */ class AllowedTagsTest extends TestCase { - - /** - * @var AllowedTags - */ - protected $class; - - /** - * Set up the test class - */ - public function setUp() - { - $this->class = new AllowedTags(); - } - /** * Test that the class implements the interface */ public function testItImplementsTheInterface() { - $this->assertInstanceOf('enshrined\svgSanitize\data\TagInterface', $this->class); + $class = new AllowedTags(); + self::assertInstanceOf('enshrined\svgSanitize\data\TagInterface', $class); } /** @@ -37,7 +24,6 @@ public function testItImplementsTheInterface() public function testThatItReturnsAnArray() { $result = AllowedTags::getTags(); - - $this->assertInternalType('array', $result); + self::assertSame('array', gettype($result)); } -} \ No newline at end of file +} diff --git a/vendor/enshrined/svg-sanitize/tests/SanitizerTest.php b/vendor/enshrined/svg-sanitize/tests/SanitizerTest.php index c27a174e4ed2e86cbd9757b905796a6ae8ee4caf..c5536b8a3ffb37b73d9b700a3f8785112a608551 100644 --- a/vendor/enshrined/svg-sanitize/tests/SanitizerTest.php +++ b/vendor/enshrined/svg-sanitize/tests/SanitizerTest.php @@ -11,32 +11,15 @@ */ class SanitizerTest extends TestCase { - /** - * @var Sanitizer - */ - protected $class; - - /** - * Set up the test class - */ - protected function setUp() - { - $this->class = new Sanitizer(); - } - - protected function tearDown() - { - unset($this->class); - } - /** * Make sure the initial tags are loaded */ public function testLoadDefaultTags() { - $tags = $this->class->getAllowedTags(); + $sanitizer = new Sanitizer(); + $tags = $sanitizer->getAllowedTags(); - $this->assertInternalType('array', $tags); + self::assertSame('array', gettype($tags)); } /** @@ -44,9 +27,10 @@ public function testLoadDefaultTags() */ public function testLoadDefaultAttributes() { - $attributes = $this->class->getAllowedAttrs(); + $sanitizer = new Sanitizer(); + $attributes = $sanitizer->getAllowedAttrs(); - $this->assertInternalType('array', $attributes); + self::assertSame('array', gettype($attributes)); } /** @@ -54,13 +38,12 @@ public function testLoadDefaultAttributes() */ public function testSetCustomTags() { - $this->class->setAllowedTags(new TestAllowedTags()); - - $tags = $this->class->getAllowedTags(); - - $this->assertInternalType('array', $tags); + $sanitizer = new Sanitizer(); + $sanitizer->setAllowedTags(new TestAllowedTags()); + $tags = $sanitizer->getAllowedTags(); - $this->assertEquals(array_map('strtolower', TestAllowedTags::getTags()), $tags); + self::assertSame('array', gettype($tags)); + self::assertSame(array_map('strtolower', TestAllowedTags::getTags()), $tags); } /** @@ -68,13 +51,12 @@ public function testSetCustomTags() */ public function testSetCustomAttributes() { - $this->class->setAllowedAttrs(new TestAllowedAttributes()); + $sanitizer = new Sanitizer(); + $sanitizer->setAllowedAttrs(new TestAllowedAttributes()); + $attributes = $sanitizer->getAllowedAttrs(); - $attributes = $this->class->getAllowedAttrs(); - - $this->assertInternalType('array', $attributes); - - $this->assertEquals( array_map('strtolower', TestAllowedAttributes::getAttributes()), $attributes); + self::assertSame('array', gettype($attributes)); + self::assertSame( array_map('strtolower', TestAllowedAttributes::getAttributes()), $attributes); } /** @@ -86,9 +68,10 @@ public function testSanitizeXMLDoc() $initialData = file_get_contents($dataDirectory . '/xmlTestOne.xml'); $expected = file_get_contents($dataDirectory . '/xmlCleanOne.xml'); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -100,9 +83,10 @@ public function testSanitizeSVGDoc() $initialData = file_get_contents($dataDirectory . '/svgTestOne.svg'); $expected = file_get_contents($dataDirectory . '/svgCleanOne.svg'); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -113,9 +97,10 @@ public function testBadXMLReturnsFalse() $dataDirectory = __DIR__ . '/data'; $initialData = file_get_contents($dataDirectory . '/badXmlTestOne.svg'); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertEquals(false, $cleanData); + self::assertSame(false, $cleanData); } /** @@ -127,9 +112,10 @@ public function testSanitizeHrefs() $initialData = file_get_contents($dataDirectory . '/hrefTestOne.svg'); $expected = file_get_contents($dataDirectory . '/hrefCleanOne.svg'); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -141,9 +127,10 @@ public function testSanitizeHrefsNoXlinkNamespace() $initialData = file_get_contents($dataDirectory . '/hrefTestTwo.svg'); $expected = file_get_contents($dataDirectory . '/hrefCleanTwo.svg'); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -155,11 +142,11 @@ public function testSanitizeExternal() $initialData = file_get_contents($dataDirectory . '/externalTest.svg'); $expected = file_get_contents($dataDirectory . '/externalClean.svg'); - $this->class->removeRemoteReferences(true); - $cleanData = $this->class->sanitize($initialData); - $this->class->removeRemoteReferences(false); + $sanitizer = new Sanitizer(); + $sanitizer->removeRemoteReferences(true); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -171,11 +158,11 @@ public function testSanitizeAndMinifiySVGDoc() $initialData = file_get_contents($dataDirectory . '/svgTestOne.svg'); $expected = file_get_contents($dataDirectory . '/svgCleanOneMinified.svg'); - $this->class->minify(true); - $cleanData = $this->class->sanitize($initialData); - $this->class->minify(false); + $sanitizer = new Sanitizer(); + $sanitizer->minify(true); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -187,11 +174,11 @@ public function testThatAriaAndDataAttributesAreAllowed() $initialData = file_get_contents($dataDirectory . '/ariaDataTest.svg'); $expected = file_get_contents($dataDirectory . '/ariaDataClean.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); - $this->class->minify(false); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -203,11 +190,11 @@ public function testThatExternalUseElementsAreStripped() $initialData = file_get_contents($dataDirectory . '/useTest.svg'); $expected = file_get_contents($dataDirectory . '/useClean.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); - $this->class->minify(false); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -215,13 +202,15 @@ public function testThatExternalUseElementsAreStripped() */ public function testMinifiedOptions() { - $this->class->minify(true); - $this->class->removeXMLTag(true); - $this->class->setXMLOptions(0); + $sanitizer = new Sanitizer(); + $sanitizer->minify(true); + $sanitizer->removeXMLTag(true); + $sanitizer->setXMLOptions(0); $input = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><title>chevron-double-down</title><path d="M4 11.73l.68-.73L12 17.82 19.32 11l.68.73-7.66 7.13a.5.5 0 0 1-.68 0z"/><path d="M4 5.73L4.68 5 12 11.82 19.32 5l.68.73-7.66 7.13a.5.5 0 0 1-.68 0z"/></svg>'; - $output = $this->class->sanitize($input); - $this->assertEquals($input, $output); + $output = $sanitizer->sanitize($input); + + self::assertSame($input, $output); } /** @@ -233,10 +222,11 @@ public function useRecursionsAreDetected() $initialData = file_get_contents($dataDirectory . '/xlinkLaughsTest.svg'); $expected = file_get_contents($dataDirectory . '/xlinkLaughsClean.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -248,10 +238,28 @@ public function infiniteUseLoopsAreDetected() $initialData = file_get_contents($dataDirectory . '/xlinkLoopTest.svg'); $expected = file_get_contents($dataDirectory . '/xlinkLoopClean.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); + + self::assertXmlStringEqualsXmlString($expected, $cleanData); + } + + /** + * @test + */ + public function doctypeAndEntityAreRemoved() + { + $dataDirectory = __DIR__ . '/data'; + $initialData = file_get_contents($dataDirectory . '/entityTest.svg'); + $expected = file_get_contents($dataDirectory . '/entityClean.svg'); + + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $sanitizer->removeRemoteReferences(true); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertSame($expected, $cleanData); } /** @@ -263,10 +271,11 @@ public function testUseDOSattacksAreNullified() $initialData = file_get_contents($dataDirectory . '/useDosTest.svg'); $expected = file_get_contents($dataDirectory . '/useDosClean.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } /** @@ -279,9 +288,10 @@ public function testLargeUseDOSattacksAreNullified() $initialData = file_get_contents($dataDirectory . '/useDosTestTwo.svg'); $expected = file_get_contents($dataDirectory . '/useDosCleanTwo.svg'); - $this->class->minify(false); - $cleanData = $this->class->sanitize($initialData); + $sanitizer = new Sanitizer(); + $sanitizer->minify(false); + $cleanData = $sanitizer->sanitize($initialData); - $this->assertXmlStringEqualsXmlString($expected, $cleanData); + self::assertXmlStringEqualsXmlString($expected, $cleanData); } } diff --git a/vendor/enshrined/svg-sanitize/tests/SubjectTest.php b/vendor/enshrined/svg-sanitize/tests/SubjectTest.php index a036086277370c2d940128df3ee7eda7771eed93..94c233f042b40472f25a38d8754f0b08e499bce9 100644 --- a/vendor/enshrined/svg-sanitize/tests/SubjectTest.php +++ b/vendor/enshrined/svg-sanitize/tests/SubjectTest.php @@ -9,6 +9,9 @@ */ class SubjectTest extends TestCase { + /** + * @var int + */ protected $nestingLimit = 15; /** diff --git a/vendor/enshrined/svg-sanitize/tests/data/entityClean.svg b/vendor/enshrined/svg-sanitize/tests/data/entityClean.svg new file mode 100644 index 0000000000000000000000000000000000000000..a7c49b4d49d26cb5c4546aeec026141996cf4760 --- /dev/null +++ b/vendor/enshrined/svg-sanitize/tests/data/entityClean.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg xmlns="http://www.w3.org/2000/svg"> + <text x="0" y="20" font-size="20">&lab;</text> +</svg> diff --git a/vendor/enshrined/svg-sanitize/tests/data/entityTest.svg b/vendor/enshrined/svg-sanitize/tests/data/entityTest.svg new file mode 100644 index 0000000000000000000000000000000000000000..bc2d3defac21dcd8a99e1a56f320b746f5761539 --- /dev/null +++ b/vendor/enshrined/svg-sanitize/tests/data/entityTest.svg @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE fortiguard [ <!ENTITY lab "cool, text as an image">]> +<svg xmlns="http://www.w3.org/2000/svg"> + <text x="0" y="20" font-size="20">&lab;</text> +</svg> \ No newline at end of file diff --git a/web/modules/admin_toolbar/admin_toolbar.info.yml b/web/modules/admin_toolbar/admin_toolbar.info.yml index 6d6b70d1deb9ede2dee714a6360635085b5b3841..5f7085cfee2124af65380ea8a9727ff21d25071e 100644 --- a/web/modules/admin_toolbar/admin_toolbar.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8.0 || ^9 dependencies: - drupal:toolbar -# Information added by Drupal.org packaging script on 2021-08-25 -version: '3.0.2' +# Information added by Drupal.org packaging script on 2021-09-22 +version: '3.0.3' project: 'admin_toolbar' -datestamp: 1629882676 +datestamp: 1632322070 diff --git a/web/modules/admin_toolbar/admin_toolbar.install b/web/modules/admin_toolbar/admin_toolbar.install index bd80e9a06852a012aa375fd61918a93ac15fb8c2..862cee8dea70d843145a627eb16f9189c34f09e5 100755 --- a/web/modules/admin_toolbar/admin_toolbar.install +++ b/web/modules/admin_toolbar/admin_toolbar.install @@ -14,3 +14,17 @@ function admin_toolbar_update_8001() { // Rebuilding the route cache. \Drupal::service("router.builder")->rebuild(); } + +/** + * Add menu_depth param into the config. + * + * @see https://www.drupal.org/project/admin_toolbar/issues/3200542 + */ +function admin_toolbar_update_8002() { + $config_factory = \Drupal::configFactory(); + $config = $config_factory->getEditable('admin_toolbar.settings'); + if (empty($config->get('menu_depth'))) { + $config->set('menu_depth', 4); + $config->save(TRUE); + } +} diff --git a/web/modules/admin_toolbar/admin_toolbar.links.menu.yml b/web/modules/admin_toolbar/admin_toolbar.links.menu.yml new file mode 100644 index 0000000000000000000000000000000000000000..904c8eae83e9cf4dbab4fa404da2c905a33e5d8f --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar.links.menu.yml @@ -0,0 +1,5 @@ +admin_toolbar.settings: + title: 'Admin Toolbar' + description: 'Configure the Admin Toolbar module.' + route_name: admin_toolbar.settings + parent: system.admin_config_ui diff --git a/web/modules/admin_toolbar/admin_toolbar.routing.yml b/web/modules/admin_toolbar/admin_toolbar.routing.yml new file mode 100644 index 0000000000000000000000000000000000000000..42ecfd40734d74b2404f68912aca405eaa752347 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar.routing.yml @@ -0,0 +1,7 @@ +admin_toolbar.settings: + path: '/admin/config/user-interface/admin-toolbar' + defaults: + _form: '\Drupal\admin_toolbar\Form\AdminToolbarSettingsForm' + _title: 'Admin Toolbar settings' + requirements: + _permission: 'administer site configuration' diff --git a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml index 3751d83ac004c63c9aab270cace565a6881d2116..55b4877dbb1bcc59d5c92ec0cd95df0aed0ed394 100644 --- a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - admin_toolbar:admin_toolbar -# Information added by Drupal.org packaging script on 2021-08-25 -version: '3.0.2' +# Information added by Drupal.org packaging script on 2021-09-22 +version: '3.0.3' project: 'admin_toolbar' -datestamp: 1629882676 +datestamp: 1632322070 diff --git a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module index a415d136208f73aa7f04b6b9e67b2799fb85e033..cec6a7c71fa797b2f4ef407ad4431d1d9f36d451 100755 --- a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module +++ b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module @@ -58,6 +58,7 @@ function admin_toolbar_links_access_filter_preprocess_menu(&$variables) { * Hides links from admin menu, if user doesn't have access rights. */ function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$items) { + $access_manager = \Drupal::accessManager(); foreach ($items as $menu_id => &$item) { $route_name = NULL; $route_params = []; @@ -83,8 +84,7 @@ function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$i } // Check, if user has access rights to the route. - if (!\Drupal::accessManager() - ->checkNamedRoute($route_name, $route_params)) { + if (!$access_manager->checkNamedRoute($route_name, $route_params)) { unset($items[$menu_id]); } else { @@ -92,8 +92,7 @@ function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$i // Recursively call this function for the child items. admin_toolbar_links_access_filter_filter_non_accessible_links($items[$menu_id]['below']); } - if (empty($items[$menu_id]['below']) && \Drupal::moduleHandler() - ->moduleExists('admin_toolbar')) { + if (empty($items[$menu_id]['below'])) { // Every child item has been cleared out. // Now check, if the given route represents an overview page only, diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml index 2536e7a0c1b7714570a07509a0a027a0d88c95f8..7ae3778224a93138159fb65463b3e19ad7394e55 100644 --- a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml @@ -3,10 +3,11 @@ description: Provides search of Admin Toolbar items. package: Administration type: module core_version_requirement: ^8.8.0 || ^9.0 +configure: admin_toolbar_search.settings dependencies: - admin_toolbar:admin_toolbar_tools -# Information added by Drupal.org packaging script on 2021-08-25 -version: '3.0.2' +# Information added by Drupal.org packaging script on 2021-09-22 +version: '3.0.3' project: 'admin_toolbar' -datestamp: 1629882676 +datestamp: 1632322070 diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.links.menu.yml b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.links.menu.yml new file mode 100644 index 0000000000000000000000000000000000000000..4a39951d61ad7fb0819b4e7a94cace78f3390dd2 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.links.menu.yml @@ -0,0 +1,5 @@ +admin_toolbar_search.settings: + title: 'Admin Toolbar Search' + description: 'Configure the Admin Toolbar Search module.' + route_name: admin_toolbar_search.settings + parent: system.admin_config_ui diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module index dcdb4a699070fa04cd6c349b293f5da5b09db981..047e485f6cfe5735834b0c1ec16643a91ff39c5b 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module @@ -7,6 +7,7 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Url; /** * Implements hook_help(). @@ -33,38 +34,91 @@ function admin_toolbar_search_toolbar_alter(&$items) { $admin_toolbar_tools_enabled = \Drupal::service('module_handler') ->moduleExists('admin_toolbar_tools'); - $items['administration_search'] = [ - "#type" => "toolbar_item", - '#weight' => 100, - 'tab' => [ - 'search' => [ - '#type' => 'textfield', - '#size' => 30, + $config = \Drupal::config('admin_toolbar_search.settings'); + $display_menu_item = $config->get('display_menu_item'); + + if (!$display_menu_item) { + $items['administration_search'] = [ + "#type" => "toolbar_item", + '#weight' => 100, + 'tab' => [ + 'search' => [ + '#title' => t('Search'), + '#title_display' => 'invisible', + '#type' => 'search', + '#size' => 30, + '#attributes' => [ + 'placeholder' => new TranslatableMarkup('Admin Toolbar quick search'), + ], + '#id' => 'admin-toolbar-search-input', + ], + ], + '#attached' => [ + 'library' => [ + 'admin_toolbar_search/search', + ], + 'drupalSettings' => [ + 'adminToolbarSearch' => [ + 'loadExtraLinks' => $admin_toolbar_tools_enabled, + ], + ], + ], + '#wrapper_attributes' => [ + 'id' => 'admin-toolbar-search-tab', + ], + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + 'tags' => [ + 'config:admin_toolbar_search.settings', + ], + ], + ]; + } + else { + $items['administration_search'] = [ + "#type" => "toolbar_item", + 'tab' => [ + '#type' => 'link', + '#title' => new TranslatableMarkup('Search'), + '#url' => URL::fromRoute('system.admin'), '#attributes' => [ - 'id' => 'admin-toolbar-search-input', - 'aria-labelledby' => 'toolbar-item-administration-search', - 'placeholder' => new TranslatableMarkup('Admin Toolbar quick search'), + 'class' => [ + 'toolbar-icon', + ], ], ], - ], - '#attached' => [ - 'library' => [ - 'admin_toolbar_search/search', + 'tray' => [ + 'search' => [ + '#title' => t('Search'), + '#type' => 'search', + '#size' => 60, + '#id' => 'admin-toolbar-search-input', + ], ], - 'drupalSettings' => [ - 'adminToolbarSearch' => [ - 'loadExtraLinks' => $admin_toolbar_tools_enabled, + '#attached' => [ + 'library' => [ + 'admin_toolbar_search/search', + ], + 'drupalSettings' => [ + 'adminToolbarSearch' => [ + 'loadExtraLinks' => $admin_toolbar_tools_enabled, + ], ], ], - ], - '#wrapper_attributes' => [ - 'id' => 'admin-toolbar-search-tab', - ], - '#cache' => [ - 'contexts' => [ - 'user.permissions', + '#wrapper_attributes' => [ + "id" => "admin-toolbar-search-tab", ], - ], - ]; + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + 'tags' => [ + 'config:admin_toolbar_search.settings', + ], + ], + ]; + } } diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.routing.yml b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.routing.yml index 14adc551599cc40ab387c0ee68b7efadd407f115..d9210101f2732471763d9475b5620c2a0562ca69 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.routing.yml +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.routing.yml @@ -4,3 +4,11 @@ admin_toolbar.search: _controller: '\Drupal\admin_toolbar_search\Controller\AdminToolbarSearchController::search' requirements: _permission: 'use admin toolbar search' + +admin_toolbar_search.settings: + path: '/admin/config/user-interface/admin-toolbar-search-settings' + defaults: + _title: 'Admin toolbar search settings' + _form: 'Drupal\admin_toolbar_search\Form\AdminToolbarSearchSettingsForm' + requirements: + _permission: 'administer site configuration' diff --git a/web/modules/admin_toolbar/admin_toolbar_search/config/install/admin_toolbar_search.settings.yml b/web/modules/admin_toolbar/admin_toolbar_search/config/install/admin_toolbar_search.settings.yml new file mode 100644 index 0000000000000000000000000000000000000000..00d03ac1f676264832c93ef2578a24c0a0f14b26 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/config/install/admin_toolbar_search.settings.yml @@ -0,0 +1 @@ +display_menu_item: 0 diff --git a/web/modules/admin_toolbar/admin_toolbar_search/config/schema/admin_toolbar_search.schema.yml b/web/modules/admin_toolbar/admin_toolbar_search/config/schema/admin_toolbar_search.schema.yml new file mode 100644 index 0000000000000000000000000000000000000000..cd398e7474d8388d5e3719defebbb596cbf3a091 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/config/schema/admin_toolbar_search.schema.yml @@ -0,0 +1,7 @@ +admin_toolbar_search.settings: + type: config_object + label: 'Admin Toolbar Search settings' + mapping: + display_menu_item: + type: integer + label: 'How the serach input will be displayed' diff --git a/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css index 4e7b028d0d3ddd79012df3ee5224e3cd0d4dfcbf..62e965503275dc87237536a6bfaebcae40e937f0 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css +++ b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css @@ -17,7 +17,7 @@ } .ui-autocomplete .ui-menu-item span.admin-toolbar-search-url { - color: rgba(0, 0, 0, 0.50); + display: none; } .admin-toolbar-search-autocomplete-list { @@ -28,3 +28,32 @@ .admin-toolbar-search-autocomplete-list .ui-menu-item .ui-state-active { margin: 0; } + +#toolbar-item-administration-search-tray label { + display: inline-block; + color: #000000; + margin-right: .5em; + font-weight: bold; +} + +#toolbar-item-administration-search-tray div.form-item { + margin: 0.75em 0; +} + +#toolbar-item-administration-search-tray input { + display: inline-block; + padding: 0.3em 0.4em 0.3em 0.5em; + font-size: 1em; +} + +#admin-toolbar-search-tab .toolbar-item:before { + background-image: url('../../misc/icons/bebebe/loupe.svg'); +} + +#admin-toolbar-search-tab .toolbar-item:active:before, +#admin-toolbar-search-tab .toolbar-item.is-active:before { + background-image: url('../../misc/icons/ffffff/loupe.svg'); +} +#toolbar-item-administration-search-tray div.form-item.js-form-type-textfield { + margin: 0.75em 0; +} diff --git a/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js index 721da1f7c4f35cae44fc2760269e64228ec05f00..877272fbfe67410e38190d6425575b8ee134c7d4 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js +++ b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js @@ -58,7 +58,7 @@ }).data("ui-autocomplete")._renderItem = (function (ul, item) { ul.addClass('admin-toolbar-search-autocomplete-list'); return $("<li>") - .append('<div>' + item.labelRaw + '<span class="admin-toolbar-search-url">' + '</span></div>') + .append('<div>' + item.labelRaw + '<span class="admin-toolbar-search-url">' + item.value + '</span></div>') .appendTo(ul); }); diff --git a/web/modules/admin_toolbar/admin_toolbar_search/src/Form/AdminToolbarSearchSettingsForm.php b/web/modules/admin_toolbar/admin_toolbar_search/src/Form/AdminToolbarSearchSettingsForm.php new file mode 100644 index 0000000000000000000000000000000000000000..1ffb3ea07961217040defb314b28856e991f817a --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/src/Form/AdminToolbarSearchSettingsForm.php @@ -0,0 +1,50 @@ +<?php + +namespace Drupal\admin_toolbar_search\Form; + +use Drupal\Core\Form\ConfigFormBase; +use Drupal\Core\Form\FormStateInterface; + +/** + * Configure Admin Toolbar Search settings for this site. + */ +class AdminToolbarSearchSettingsForm extends ConfigFormBase { + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'admin_toolbar_search_admin_toolbar_search_settings'; + } + + /** + * {@inheritdoc} + */ + protected function getEditableConfigNames() { + return ['admin_toolbar_search.settings']; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $form['display_menu_item'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Display the search input as a menu item.'), + '#description' => $this->t("if set, instead of display a text input field, it's displayed a menu item in the toolbar so the user has to click on it to toggle the search input."), + '#default_value' => $this->config('admin_toolbar_search.settings')->get('display_menu_item'), + ]; + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('admin_toolbar_search.settings') + ->set('display_menu_item', $form_state->getValue('display_menu_item')) + ->save(); + parent::submitForm($form, $form_state); + } + +} diff --git a/web/modules/admin_toolbar/admin_toolbar_search/tests/src/Functional/AdminToolbarSearchSettingTest.php b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/Functional/AdminToolbarSearchSettingTest.php new file mode 100644 index 0000000000000000000000000000000000000000..71ad1257b231e745534521c4e1e88e441847c017 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/Functional/AdminToolbarSearchSettingTest.php @@ -0,0 +1,82 @@ +<?php + +namespace Drupal\Tests\admin_toolbar_search\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Test the functionality of admin toolbar search. + * + * @group admin_toolbar + * @group admin_toolbar_search + */ +class AdminToolbarSearchSettingTest extends BrowserTestBase { + + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + + /** + * {@inheritdoc} + */ + protected static $modules = [ + 'admin_toolbar_search', + 'node', + 'media', + 'field_ui', + 'menu_ui', + 'block', + ]; + + /** + * A user with the 'Use Admin Toolbar search' permission. + * + * @var \Drupal\user\UserInterface + */ + protected $userWithAccess; + + /** + * A test user without the 'Use Admin Toolbar search' permission.. + * + * @var \Drupal\user\UserInterface + */ + protected $noAccessUser; + + public function setUp(): void { + parent::setUp(); + + $permissions = [ + 'access toolbar', + 'administer menu', + 'access administration pages', + 'administer site configuration', + 'administer content types', + ]; + $this->noAccessUser = $this->drupalCreateUser($permissions); + $permissions[] = 'use admin toolbar search'; + $this->userWithAccess = $this->drupalCreateUser($permissions); + } + + /** + * Tests search functionality without admin_toolbar_tools enabled. + */ + public function testToolbarSearch() { + $this->drupalLogin($this->userWithAccess); + + $this->drupalGet(Url::fromRoute('system.admin')); + $this->assertSession()->responseNotContains('id="toolbar-item-administration-search'); + + $this->config('admin_toolbar_search.settings')->set('display_menu_item', 1); + $this->config('admin_toolbar_search.settings')->save(); + $this->drupalGet(Url::fromRoute('system.admin')); + $this->assertSession()->responseContains('id="toolbar-item-administration-search'); + + $this->config('admin_toolbar_search.settings')->set('display_menu_item', 0); + $this->config('admin_toolbar_search.settings')->save(); + $this->drupalGet(Url::fromRoute('system.admin')); + $this->assertSession()->responseNotContains('id="toolbar-item-administration-search'); + } + +} diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml b/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml index 1bfd11c27a7aec2721ec43f68db0390d14866ad4..059a4f1684a891dedc6d065a4b6a4f217532a1bf 100644 --- a/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml @@ -7,7 +7,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - admin_toolbar:admin_toolbar -# Information added by Drupal.org packaging script on 2021-08-25 -version: '3.0.2' +# Information added by Drupal.org packaging script on 2021-09-22 +version: '3.0.3' project: 'admin_toolbar' -datestamp: 1629882676 +datestamp: 1632322070 diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php b/web/modules/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php index 4d98f3e2b753f3f7d0ea57adce7c96466605f1a2..8b6cdf9d6c5b4c205e6bd6c39cd1982fa4e8f62a 100755 --- a/web/modules/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php +++ b/web/modules/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php @@ -2,15 +2,15 @@ namespace Drupal\admin_toolbar_tools\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\system\Entity\Menu; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Extension\ThemeHandlerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteProviderInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\StringTranslation\StringTranslationTrait; -use Drupal\system\Entity\Menu; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -376,8 +376,8 @@ public function getDerivativeDefinitions($base_plugin_definition) { 'route_parameters' => ['menu' => $menu_id], ] + $base_plugin_definition; // Un-deletable menus. - $menus = ['admin', 'devel', 'footer', 'main', 'tools', 'account']; - if (!in_array($menu_id, $menus)) { + $un_deletable_menus = ['admin', 'devel', 'footer', 'main', 'tools', 'account']; + if (!in_array($menu_id, $un_deletable_menus)) { $links['entity.menu.delete_form.' . $menu_id] = [ 'title' => $this->t('Delete'), 'route_name' => 'entity.menu.delete_form', @@ -585,12 +585,12 @@ public function getDerivativeDefinitions($base_plugin_definition) { 'route_name' => 'entity.media.collection', 'parent' => 'system.admin_content', ] + $base_plugin_definition; - if ($this->moduleHandler->moduleExists('media_library')) { + if ($this->moduleHandler->moduleExists('media_library') && $this->routeExists('view.media_library.page')) { $links['media_library'] = [ - 'title' => $this->t('Media library'), - 'route_name' => 'view.media_library.page', - 'parent' => $base_plugin_definition['id'] . ':media_page', - ] + $base_plugin_definition; + 'title' => $this->t('Media library'), + 'route_name' => 'view.media_library.page', + 'parent' => $base_plugin_definition['id'] . ':media_page', + ] + $base_plugin_definition; } $links['add_media'] = [ 'title' => $this->t('Add media'), diff --git a/web/modules/admin_toolbar/config/install/admin_toolbar.settings.yml b/web/modules/admin_toolbar/config/install/admin_toolbar.settings.yml new file mode 100644 index 0000000000000000000000000000000000000000..5965a3170e12a3e35dc55a7c85e09ee40cc9c9ed --- /dev/null +++ b/web/modules/admin_toolbar/config/install/admin_toolbar.settings.yml @@ -0,0 +1 @@ +menu_depth: 4 diff --git a/web/modules/admin_toolbar/config/schema/admin_toolbar.schema.yml b/web/modules/admin_toolbar/config/schema/admin_toolbar.schema.yml new file mode 100644 index 0000000000000000000000000000000000000000..68ec44e0b8c585cb60be7b65f75cd69b599eafb3 --- /dev/null +++ b/web/modules/admin_toolbar/config/schema/admin_toolbar.schema.yml @@ -0,0 +1,7 @@ +admin_toolbar.settings: + type: config_object + label: 'Admin Toolbar settings' + mapping: + menu_depth: + type: integer + label: 'Depth of displayed menu' diff --git a/web/modules/admin_toolbar/css/admin.toolbar_search.css b/web/modules/admin_toolbar/css/admin.toolbar_search.css index 115c0c2fde4b8560f320d74eed0c3f8963136cf6..d4a18daad3d08e9a364c612d02bc095e7cec2ee0 100755 --- a/web/modules/admin_toolbar/css/admin.toolbar_search.css +++ b/web/modules/admin_toolbar/css/admin.toolbar_search.css @@ -29,5 +29,5 @@ } .ui-autocomplete .ui-menu-item span.admin-toolbar-search-url { - color: rgba(0, 0, 0, 0.5); + display: none; } diff --git a/web/modules/admin_toolbar/src/Form/AdminToolbarSettingsForm.php b/web/modules/admin_toolbar/src/Form/AdminToolbarSettingsForm.php new file mode 100644 index 0000000000000000000000000000000000000000..c7151c686c4f519d41bee6db9ea19f4d93155187 --- /dev/null +++ b/web/modules/admin_toolbar/src/Form/AdminToolbarSettingsForm.php @@ -0,0 +1,105 @@ +<?php + +namespace Drupal\admin_toolbar\Form; + +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Form\ConfigFormBase; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Menu\MenuLinkManagerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Class AdminToolbarSettingsForm. The config form for the admin_toolbar module. + * + * @package Drupal\admin_toolbar\Form + */ +class AdminToolbarSettingsForm extends ConfigFormBase { + + /** + * The cache menu instance. + * + * @var \Drupal\Core\Cache\CacheBackendInterface + */ + protected $cacheMenu; + + /** + * The menu link manager instance. + * + * @var \Drupal\Core\Menu\MenuLinkManagerInterface + */ + protected $menuLinkManager; + + /** + * AdminToolbarSettingsForm constructor. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory for the form. + * @param \Drupal\Core\Menu\MenuLinkManagerInterface $menuLinkManager + * A menu link manager instance. + * @param \Drupal\Core\Cache\CacheBackendInterface $cacheMenu + * A cache menu instance. + */ + public function __construct(ConfigFactoryInterface $config_factory, MenuLinkManagerInterface $menuLinkManager, CacheBackendInterface $cacheMenu) { + parent::__construct($config_factory); + $this->cacheMenu = $cacheMenu; + $this->menuLinkManager = $menuLinkManager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('config.factory'), + $container->get('plugin.manager.menu.link'), + $container->get('cache.menu') + ); + } + + /** + * {@inheritDoc} + */ + protected function getEditableConfigNames() { + return [ + 'admin_toolbar.settings', + ]; + } + + /** + * {@inheritDoc} + */ + public function getFormId() { + return 'admin_toolbar_settings'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $config = $this->config('admin_toolbar.settings'); + $depth_values = range(1, 9); + $form['menu_depth'] = [ + '#type' => 'select', + '#title' => $this->t('Menu depth'), + '#description' => $this->t('Maximal depth of displayed menu.'), + '#default_value' => $config->get('menu_depth'), + '#options' => array_combine($depth_values, $depth_values), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('admin_toolbar.settings') + ->set('menu_depth', $form_state->getValue('menu_depth')) + ->save(); + parent::submitForm($form, $form_state); + $this->cacheMenu->invalidateAll(); + $this->menuLinkManager->rebuild(); + } + +} diff --git a/web/modules/admin_toolbar/src/Render/Element/AdminToolbar.php b/web/modules/admin_toolbar/src/Render/Element/AdminToolbar.php index 5d0000011f2c8c88469c1ecb6405496a3c364bf4..bd7de64b18efdbaa81b151edccd390d5426c8769 100644 --- a/web/modules/admin_toolbar/src/Render/Element/AdminToolbar.php +++ b/web/modules/admin_toolbar/src/Render/Element/AdminToolbar.php @@ -36,7 +36,8 @@ public static function trustedCallbacks() { public static function preRenderTray(array $build) { $menu_tree = \Drupal::service('toolbar.menu_tree'); $parameters = new MenuTreeParameters(); - $parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth(4)->onlyEnabledLinks(); + $max_depth = \Drupal::config('admin_toolbar.settings')->get('menu_depth'); + $parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth($max_depth)->onlyEnabledLinks(); $tree = $menu_tree->load(NULL, $parameters); $manipulators = [ ['callable' => 'menu.default_tree_manipulators:checkAccess'], diff --git a/web/modules/simple_sitemap/composer.json b/web/modules/simple_sitemap/composer.json index 18450ea707725843e30e2d12fd1725713089301e..0fc798ba86d45774e89ccd3311bd72aa2569304f 100644 --- a/web/modules/simple_sitemap/composer.json +++ b/web/modules/simple_sitemap/composer.json @@ -5,9 +5,9 @@ "homepage": "https://drupal.org/project/simple_sitemap", "authors": [ { - "name": "Pawel Ginalski (gbyte.co)", - "email": "contact@gbyte.co", - "homepage": "https://www.drupal.org/u/gbyte.co", + "name": "Pawel Ginalski (gbyte)", + "email": "contact@gbyte.dev", + "homepage": "https://www.drupal.org/u/gbyte", "role": "Maintainer" } ], diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_engines/config/install/simple_sitemap_engines.settings.yml b/web/modules/simple_sitemap/modules/simple_sitemap_engines/config/install/simple_sitemap_engines.settings.yml index 4c544c1d14f56a25ff4bccd832b9f76d39580551..bd3d661f5d6fc1e5b907e430aeb3d5b8f0144a72 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_engines/config/install/simple_sitemap_engines.settings.yml +++ b/web/modules/simple_sitemap/modules/simple_sitemap_engines/config/install/simple_sitemap_engines.settings.yml @@ -1,2 +1,2 @@ enabled: true -submission_interval: 86400 +submission_interval: 24 diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.info.yml b/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.info.yml index b4fcceb42fbcc9843003d33645527dae88c3b63c..bd11eb5d695d5c11fea6fd70359cf368e39952e1 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.info.yml +++ b/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8 || ^9 dependencies: - simple_sitemap:simple_sitemap -# Information added by Drupal.org packaging script on 2021-04-07 -version: '8.x-3.10' +# Information added by Drupal.org packaging script on 2021-10-16 +version: '8.x-3.11' project: 'simple_sitemap' -datestamp: 1617833759 +datestamp: 1634343987 diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.install b/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.install index 1a52b73c53aab5bdcd904eb84b0e315a5ed3838b..83448d61d2e923d379e82a99f4c24334fcb95048 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.install +++ b/web/modules/simple_sitemap/modules/simple_sitemap_engines/simple_sitemap_engines.install @@ -38,3 +38,13 @@ function simple_sitemap_engines_update_8301() { } } } + +/** + * Fixing erroneous default submission interval if not yet overwritten. + */ +function simple_sitemap_engines_update_8302() { + $config = \Drupal::configFactory()->getEditable('simple_sitemap_engines.settings'); + if ($config->get('submission_interval') === 86400) { + $config->set('submission_interval', 24)->save(); + } +} diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_engines/src/Entity/SearchEngine.php b/web/modules/simple_sitemap/modules/simple_sitemap_engines/src/Entity/SearchEngine.php index 40290f94a79f484f9365deec6a3a9734bcf9ca39..2628767fdb116a0d7f9dc2fc0b5e455c1b303ee1 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_engines/src/Entity/SearchEngine.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_engines/src/Entity/SearchEngine.php @@ -26,7 +26,6 @@ * "label", * "url", * "sitemap_variants", - * "last_submitted", * } * ) */ diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/simple_sitemap_views.info.yml b/web/modules/simple_sitemap/modules/simple_sitemap_views/simple_sitemap_views.info.yml index 01d23e034b3ef862ebdbde0f9ade2f82f9f83bb0..57e79884eff6bfbf061e233d800600059bd4b529 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/simple_sitemap_views.info.yml +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/simple_sitemap_views.info.yml @@ -9,7 +9,7 @@ dependencies: - simple_sitemap:simple_sitemap - drupal:views -# Information added by Drupal.org packaging script on 2021-04-07 -version: '8.x-3.10' +# Information added by Drupal.org packaging script on 2021-10-16 +version: '8.x-3.11' project: 'simple_sitemap' -datestamp: 1617833759 +datestamp: 1634343987 diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/simple_sitemap/UrlGenerator/ViewsUrlGenerator.php b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/simple_sitemap/UrlGenerator/ViewsUrlGenerator.php index 5c203ed2972c24e6d9943b41f474909f83c3a2c1..f04a094a6bda9fd7530ce66c8a6e51acf93f6359 100755 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/simple_sitemap/UrlGenerator/ViewsUrlGenerator.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/simple_sitemap/UrlGenerator/ViewsUrlGenerator.php @@ -127,8 +127,13 @@ public function getDataSets() { 'view_id' => $view->id(), 'display_id' => $view->current_display, ]; + + $extender = $this->sitemapViews->getDisplayExtender($view); + // View path without arguments. - $data_sets[] = $base_data_set + ['arguments' => NULL]; + if (!$extender->hasRequiredArguments()) { + $data_sets[] = $base_data_set + ['arguments' => NULL]; + } // Process indexed arguments. if ($args_ids = $this->sitemapViews->getIndexableArguments($view, $this->sitemapVariant)) { diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php index accb215f2f4478b35f8ae05902ebc6c2bd6d00ad..ff735503d565f740b8d5c88c8a1223ac5dab7017 100755 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php @@ -104,6 +104,7 @@ protected function defineOptions() { */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if ($this->hasSitemapSettings() && $form_state->get('section') == 'simple_sitemap') { + $has_required_arguments = $this->hasRequiredArguments(); $arguments_options = $this->getArgumentsOptions(); $form['variants'] = [ @@ -166,6 +167,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#states' => $states, ]; + // Required arguments are always indexed. + foreach ($this->getRequiredArguments() as $argument_id) { + $variant_form['arguments'][$argument_id]['#disabled'] = TRUE; + } + // Max links with arguments. $variant_form['max_links'] = [ '#type' => 'number', @@ -173,7 +179,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#description' => $this->t('The maximum number of link variations to be indexed for this display. If left blank, each argument will create link variations for this display. Use with caution, as a large number of argument values​can significantly increase the number of sitemap links.'), '#default_value' => $settings['max_links'], '#min' => 1, - '#access' => !empty($arguments_options), + '#access' => !empty($arguments_options) || $has_required_arguments, '#states' => $states, ]; } @@ -188,8 +194,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { */ public function validateOptionsForm(&$form, FormStateInterface $form_state) { if ($this->hasSitemapSettings() && $form_state->get('section') == 'simple_sitemap') { + $required_arguments = $this->getRequiredArguments(); + foreach (array_keys($this->variants) as $variant) { - $arguments = $form_state->getValue(['variants', $variant, 'arguments'], []); + $arguments = &$form_state->getValue(['variants', $variant, 'arguments'], []); + $arguments = array_merge($arguments, $required_arguments); $errors = $this->validateIndexedArguments($arguments); foreach ($errors as $message) { @@ -287,6 +296,14 @@ public function getSitemapSettings($variant) { if (isset($this->options['variants'][$variant])) { $settings = $this->options['variants'][$variant] + $settings; } + + if (empty($this->displayHandler->getHandlers('argument'))) { + $settings['arguments'] = []; + } + else { + $required_arguments = $this->getRequiredArguments(); + $settings['arguments'] = array_merge($settings['arguments'], $required_arguments); + } return $settings; } @@ -300,6 +317,50 @@ public function hasSitemapSettings() { return $this->displayHandler instanceof DisplayRouterInterface; } + /** + * Gets required view arguments (presented in the path). + * + * @return array + * View arguments IDs. + */ + public function getRequiredArguments() { + $arguments = $this->displayHandler->getHandlers('argument'); + + if (!empty($arguments)) { + $bits = explode('/', $this->displayHandler->getPath()); + $arg_counter = 0; + + foreach ($bits as $bit) { + if ($bit == '%' || strpos($bit, '%') === 0) { + $arg_counter++; + } + } + + if ($arg_counter > 0) { + $arguments = array_slice(array_keys($arguments), 0, $arg_counter); + return array_combine($arguments, $arguments); + } + } + return []; + } + + /** + * Determines if the view path contains required arguments. + * + * @return bool + * TRUE if the path contains required arguments, FALSE if not. + */ + public function hasRequiredArguments() { + $bits = explode('/', $this->displayHandler->getPath()); + + foreach ($bits as $bit) { + if ($bit == '%' || strpos($bit, '%') === 0) { + return TRUE; + } + } + return FALSE; + } + /** * Returns available view arguments options. * diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/SimpleSitemapViews.php b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/SimpleSitemapViews.php index 47d580a2741cb2df5f9d3247f2b3c03f1dda1de3..4f5839302ffdef4c4000ceaaadf241222a2180f8 100755 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/src/SimpleSitemapViews.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/src/SimpleSitemapViews.php @@ -137,19 +137,17 @@ public function disable() { } /** - * Gets the sitemap settings for view display. + * Gets the display extender. * * @param \Drupal\views\ViewExecutable $view * A view executable instance. - * @param string $variant - * The name of the sitemap variant. * @param string|null $display_id * The display id. If empty uses the current display. * - * @return array|null - * The sitemap settings if the display is indexed, NULL otherwise. + * @return \Drupal\simple_sitemap_views\Plugin\views\display_extender\SimpleSitemapDisplayExtender|null + * The display extender. */ - public function getSitemapSettings(ViewExecutable $view, $variant, $display_id = NULL) { + public function getDisplayExtender(ViewExecutable $view, $display_id = NULL) { // Ensure the display was correctly set. if (!$view->setDisplay($display_id)) { return NULL; @@ -158,8 +156,30 @@ public function getSitemapSettings(ViewExecutable $view, $variant, $display_id = $extenders = $view->display_handler->getExtenders(); $extender = isset($extenders[self::PLUGIN_ID]) ? $extenders[self::PLUGIN_ID] : NULL; + if ($extender instanceof SimpleSitemapDisplayExtender) { + return $extender; + } + return NULL; + } + + /** + * Gets the sitemap settings for view display. + * + * @param \Drupal\views\ViewExecutable $view + * A view executable instance. + * @param string $variant + * The name of the sitemap variant. + * @param string|null $display_id + * The display id. If empty uses the current display. + * + * @return array|null + * The sitemap settings if the display is indexed, NULL otherwise. + */ + public function getSitemapSettings(ViewExecutable $view, $variant, $display_id = NULL) { + $extender = $this->getDisplayExtender($view, $display_id); + // Retrieve the sitemap settings from the extender. - if ($extender instanceof SimpleSitemapDisplayExtender && $extender->hasSitemapSettings()) { + if ($extender && $extender->hasSitemapSettings()) { $settings = $extender->getSitemapSettings($variant); if ($settings['index']) { @@ -187,14 +207,31 @@ public function getIndexableArguments(ViewExecutable $view, $variant, $display_i $indexable_arguments = []; // Find indexable arguments. - if ($settings && !empty($settings['arguments'])) { + if ($settings) { $arguments = array_keys($view->display_handler->getHandlers('argument')); + $bits = explode('/', $view->getPath()); + $arg_index = 0; + + // Required arguments. + foreach ($bits as $bit) { + if ($bit == '%' || strpos($bit, '%') === 0) { + $indexable_arguments[] = isset($arguments[$arg_index]) ? $arguments[$arg_index] : $bit; + $arg_index++; + } + } + + if (!empty($settings['arguments'])) { + if ($arg_index > 0) { + $arguments = array_slice($arguments, $arg_index); + } - foreach ($arguments as $argument_id) { - if (empty($settings['arguments'][$argument_id])) { - break; + // Optional arguments. + foreach ($arguments as $argument_id) { + if (empty($settings['arguments'][$argument_id])) { + break; + } + $indexable_arguments[] = $argument_id; } - $indexable_arguments[] = $argument_id; } } return $indexable_arguments; @@ -436,9 +473,10 @@ public function getIndexableViews() { } // Load views with display plugins that use the route. - $query = $this->viewStorage->getQuery(); - $query->condition('status', TRUE); - $query->condition("display.*.display_plugin", $this->getRouterDisplayPluginIds(), 'IN'); + $query = $this->viewStorage->getQuery() + ->condition('status', TRUE) + ->condition("display.*.display_plugin", $this->getRouterDisplayPluginIds(), 'IN') + ->accessCheck(TRUE); $view_ids = $query->execute(); // If there are no such views, then return an empty array. diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/config/install/views.view.simple_sitemap_views_test_view.yml b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/config/install/views.view.simple_sitemap_views_test_view.yml index acd3a247c8cf608f6fc8162fbcb6b73e77dc6ca8..6c28a2d45bbfc876cd88620039903c02a57713de 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/config/install/views.view.simple_sitemap_views_test_view.yml +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/config/install/views.view.simple_sitemap_views_test_view.yml @@ -281,3 +281,72 @@ display: - 'user.node_grants:view' - user.permissions tags: { } + page_2: + display_plugin: page + id: page_2 + display_title: 'Page 2' + position: 2 + display_options: + display_extenders: + simple_sitemap_display_extender: + variants: + default: + index: true + priority: '0.5' + changefreq: '' + arguments: { } + max_links: 2 + path: simple-sitemap-views-test-view-2/%node_type/% + rendering_language: en + arguments: + type: + id: type + table: node_field_data + field: type + relationship: none + group_type: group + admin_label: '' + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + glossary: false + limit: 0 + case: none + path_case: none + transform_dash: false + break_phrase: false + entity_type: node + entity_field: type + plugin_id: node_type + defaults: + arguments: false + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url + - 'user.node_grants:view' + - user.permissions + tags: { } diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/simple_sitemap_views_test.info.yml b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/simple_sitemap_views_test.info.yml index bbda1a92c7f0ebc23218c3e3a3876fd785ce3899..56cb4490c7a88a585253c447e0f041f6aaa73c5f 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/simple_sitemap_views_test.info.yml +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/modules/simple_sitemap_views_test/simple_sitemap_views_test.info.yml @@ -7,7 +7,7 @@ core_version_requirement: ^8 || ^9 dependencies: - simple_sitemap:simple_sitemap_views -# Information added by Drupal.org packaging script on 2021-04-07 -version: '8.x-3.10' +# Information added by Drupal.org packaging script on 2021-10-16 +version: '8.x-3.11' project: 'simple_sitemap' -datestamp: 1617833759 +datestamp: 1634343987 diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTest.php b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTest.php index 36f8035f1213920ff9a85f59b486fa18a73e4a74..bc2e27c6b185da881afd8446d113fbfcab5016ee 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTest.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTest.php @@ -46,6 +46,11 @@ public function testIndexableViews() { $this->assertContains('type', $indexable_arguments); $this->assertContains('title', $indexable_arguments); $this->assertNotContains('nid', $indexable_arguments); + + // Check the indexing status of the required arguments. + $indexable_arguments = $this->sitemapViews->getIndexableArguments($this->testView2, $this->sitemapVariant); + $this->assertContains('type', $indexable_arguments); + $this->assertContains('%', $indexable_arguments); } /** @@ -77,6 +82,10 @@ public function testAddArgumentsToIndex() { $args = ['page', $this->node2->getTitle()]; $this->sitemapViews->addArgumentsToIndex($this->testView, $args); $this->assertIndexSize(2); + + // Required arguments must be indexed. + $this->sitemapViews->addArgumentsToIndex($this->testView2, ['page', 1]); + $this->assertIndexSize(3); } /** @@ -89,14 +98,22 @@ public function testViewsUrlGenerator() { $title = $this->node->getTitle(); $this->sitemapViews->addArgumentsToIndex($this->testView, ['page']); $this->sitemapViews->addArgumentsToIndex($this->testView, ['page', $title]); + $this->sitemapViews->addArgumentsToIndex($this->testView2, ['page', 1]); $this->generator->generateSitemap('backend'); + $url1 = $this->testView->getUrl()->toString(); + $url2 = $this->testView->getUrl(['page', NULL, NULL])->toString(); + $url3 = $this->testView->getUrl(['page', $title, NULL])->toString(); + $url4 = $this->testView2->getUrl()->toString(); + $url5 = $this->testView2->getUrl(['page', 1])->toString(); + // Check that the sitemap contains view display URLs. $this->drupalGet($this->defaultSitemapUrl); - $test_view_url = $this->testView->getUrl()->toString(); - $this->assertSession()->responseContains($test_view_url); - $this->assertSession()->responseContains("$test_view_url/page"); - $this->assertSession()->responseContains("$test_view_url/page/$title"); + $this->assertSession()->responseContains($url1); + $this->assertSession()->responseContains($url2); + $this->assertSession()->responseContains($url3); + $this->assertSession()->responseNotContains($url4); + $this->assertSession()->responseContains($url5); } /** diff --git a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php index 782e8e96ec7ac5fdea2b80a5fd4dcd152fb84662..9bfb92308ed58d4d2cbaa947ea23a0d4f0e60c4f 100644 --- a/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php +++ b/web/modules/simple_sitemap/modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php @@ -40,6 +40,13 @@ abstract class SimpleSitemapViewsTestBase extends SimplesitemapTestBase { */ protected $testView; + /** + * Test view 2. + * + * @var \Drupal\views\ViewExecutable + */ + protected $testView2; + /** * The sitemap variant. * @@ -59,6 +66,9 @@ protected function setUp() { $this->testView = Views::getView('simple_sitemap_views_test_view'); $this->testView->setDisplay('page_1'); + + $this->testView2 = Views::getView('simple_sitemap_views_test_view'); + $this->testView2->setDisplay('page_2'); } /** diff --git a/web/modules/simple_sitemap/simple_sitemap.info.yml b/web/modules/simple_sitemap/simple_sitemap.info.yml index 6b4d4ca3961a124d57708ed045f674b33474dabb..21929697774f5dcd0d4737c84d61aa5b6b97d791 100644 --- a/web/modules/simple_sitemap/simple_sitemap.info.yml +++ b/web/modules/simple_sitemap/simple_sitemap.info.yml @@ -6,7 +6,7 @@ package: SEO core: 8.x core_version_requirement: ^8 || ^9 -# Information added by Drupal.org packaging script on 2021-04-07 -version: '8.x-3.10' +# Information added by Drupal.org packaging script on 2021-10-16 +version: '8.x-3.11' project: 'simple_sitemap' -datestamp: 1617833759 +datestamp: 1634343987 diff --git a/web/modules/simple_sitemap/simple_sitemap.module b/web/modules/simple_sitemap/simple_sitemap.module index dacec83fb36cb515f4fa8b4440fa08d9e445be35..ad0098166e9472790310d558585d79e97188c24d 100644 --- a/web/modules/simple_sitemap/simple_sitemap.module +++ b/web/modules/simple_sitemap/simple_sitemap.module @@ -131,7 +131,7 @@ function simple_sitemap_entity_form_submit($form, FormStateInterface &$form_stat } // Regenerate sitemaps according to user setting. - if ($values['simple_sitemap_regenerate_now']) { + if (!empty($values['simple_sitemap_regenerate_now'])) { $generator->setVariants(TRUE) ->rebuildQueue() ->generateSitemap(); diff --git a/web/modules/simple_sitemap/src/EntityHelper.php b/web/modules/simple_sitemap/src/EntityHelper.php index 6b205d4ee4947f907604bad38af32a03a34ca059..b1bc875ecfbff47a116af0f1a18445f42257650c 100644 --- a/web/modules/simple_sitemap/src/EntityHelper.php +++ b/web/modules/simple_sitemap/src/EntityHelper.php @@ -210,7 +210,7 @@ public function getEntityInstanceIds($entity_type_id, $bundle_name = NULL) { $entity_query->condition($keys['bundle'], $bundle_name); } - return $entity_query->execute(); + return $entity_query->accessCheck(TRUE)->execute(); } } diff --git a/web/modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php b/web/modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php index 1d8f7ebd90a502b30ed1ed8edef301ba7d3a9bad..8c90982d309b31ff2f9a93874cbecfb8352cbf15 100644 --- a/web/modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php +++ b/web/modules/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php @@ -214,7 +214,10 @@ protected function processDataSet($data_set) { * @inheritdoc */ public function generate($data_set) { - $path_data_sets = $this->processDataSet($data_set); + if (empty($path_data_sets = $this->processDataSet($data_set))) { + return []; + } + $url_variant_sets = []; foreach ($path_data_sets as $key => $path_data) { if (isset($path_data['url']) && $path_data['url'] instanceof Url) { diff --git a/web/modules/svg_image/modules/svg_image_responsive/svg_image_responsive.info.yml b/web/modules/svg_image/modules/svg_image_responsive/svg_image_responsive.info.yml index b3ddc7ffc866ae92bfd7292b159dc21ffda846f8..3baf9c9da2a9716d046703b018ba6d91ffd3c615 100644 --- a/web/modules/svg_image/modules/svg_image_responsive/svg_image_responsive.info.yml +++ b/web/modules/svg_image/modules/svg_image_responsive/svg_image_responsive.info.yml @@ -9,7 +9,7 @@ dependencies: - svg_image:svg_image - drupal:responsive_image -# Information added by Drupal.org packaging script on 2020-06-04 -version: '8.x-1.14' +# Information added by Drupal.org packaging script on 2021-08-18 +version: '8.x-1.15' project: 'svg_image' -datestamp: 1591251835 +datestamp: 1629259132 diff --git a/web/modules/svg_image/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php b/web/modules/svg_image/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php new file mode 100644 index 0000000000000000000000000000000000000000..a7c261f3abbeaea526c3c53eeddec5977a267dd7 --- /dev/null +++ b/web/modules/svg_image/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php @@ -0,0 +1,57 @@ +<?php + +namespace Drupal\svg_image\Plugin\Field\FieldFormatter; + +use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\Field\FieldItemListInterface; +use Drupal\image\Plugin\Field\FieldFormatter\ImageUrlFormatter; + +/** + * Plugin implementation of the 'image_url' formatter. + * + * Override default ImageUrlFormatter to proceed with svg urls. + * + * @FieldFormatter( + * id = "image_url", + * label = @Translation("URL to image"), + * field_types = { + * "image" + * } + * ) + */ +class SvgImageUrlFormatter extends ImageUrlFormatter { + + /** + * {@inheritdoc} + */ + public function viewElements(FieldItemListInterface $items, $langcode) { + $elements = []; + + /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $items */ + if (empty($images = $this->getEntitiesToView($items, $langcode))) { + // Early opt-out if the field is empty. + return $elements; + } + + /** @var \Drupal\image\ImageStyleInterface $image_style */ + $image_style = $this->imageStyleStorage->load($this->getSetting('image_style')); + /** @var \Drupal\file\FileInterface[] $images */ + foreach ($images as $delta => $image) { + $image_uri = $image->getFileUri(); + $isSvg = svg_image_is_file_svg($image); + $url = ($image_style && !$isSvg) ? $image_style->buildUrl($image_uri) : file_create_url($image_uri); + $url = file_url_transform_relative($url); + + // Add cacheability metadata from the image and image style. + $cacheability = CacheableMetadata::createFromObject($image); + if ($image_style) { + $cacheability->addCacheableDependency(CacheableMetadata::createFromObject($image_style)); + } + + $elements[$delta] = ['#markup' => $url]; + $cacheability->applyTo($elements[$delta]); + } + return $elements; + } + +} diff --git a/web/modules/svg_image/src/Plugin/Field/FieldWidget/SvgImageWidget.php b/web/modules/svg_image/src/Plugin/Field/FieldWidget/SvgImageWidget.php index d4bb5d3b0a0776fe35ebf2b9f6351215dc5364ff..fe5640dce02066e7a76e95373c1a9acbc85fdcd2 100755 --- a/web/modules/svg_image/src/Plugin/Field/FieldWidget/SvgImageWidget.php +++ b/web/modules/svg_image/src/Plugin/Field/FieldWidget/SvgImageWidget.php @@ -61,6 +61,13 @@ class SvgImageWidget extends FileWidget { */ protected $imageStyleStorage; + /** + * The image factory service. + * + * @var \Drupal\Core\Image\ImageFactory + */ + protected $imageFactory; + /** * {@inheritdoc} */ @@ -72,6 +79,7 @@ public function __construct($pluginId, $pluginDefinition, FieldDefinitionInterfa $this->renderer = $container->get('renderer'); $this->entityTypeManager = $container->get('entity_type.manager'); $this->imageStyleStorage = $this->entityTypeManager->getStorage('image_style'); + $this->imageFactory = $container->get('image.factory'); } /** @@ -182,7 +190,8 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen } // If not using custom extension validation, ensure this is an image. - $supportedExtensions = ['png', 'gif', 'jpg', 'jpeg', 'svg']; + $supportedExtensions = $this->imageFactory->getSupportedExtensions(); + $supportedExtensions[] = 'svg'; $extensions = isset($element['#upload_validators']['file_validate_extensions'][0]) ? $element['#upload_validators']['file_validate_extensions'][0] : implode(' ', $supportedExtensions); $extensions = array_intersect(explode(' ', $extensions), $supportedExtensions); $element['#upload_validators']['file_validate_extensions'][0] = implode(' ', $extensions); diff --git a/web/modules/svg_image/svg_image.info.yml b/web/modules/svg_image/svg_image.info.yml index 1ab3af2a09389fce8b7f1b789e0c42327973c0d9..dfa879d17bbb0a91883a810857c0bcbc2292697e 100644 --- a/web/modules/svg_image/svg_image.info.yml +++ b/web/modules/svg_image/svg_image.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8 || ^9 dependencies: - drupal:image -# Information added by Drupal.org packaging script on 2020-06-04 -version: '8.x-1.14' +# Information added by Drupal.org packaging script on 2021-08-18 +version: '8.x-1.15' project: 'svg_image' -datestamp: 1591251835 +datestamp: 1629259132 diff --git a/web/modules/svg_image/svg_image.module b/web/modules/svg_image/svg_image.module index 2a3daf892ea27c2898275c0408afcf6b6df7e024..cf0aae62116da32b650f1aa265541f48873f4112 100644 --- a/web/modules/svg_image/svg_image.module +++ b/web/modules/svg_image/svg_image.module @@ -7,6 +7,7 @@ use Drupal\file\Entity\File; use Drupal\svg_image\Plugin\Field\FieldFormatter\SvgImageFormatter; +use Drupal\svg_image\Plugin\Field\FieldFormatter\SvgImageUrlFormatter; use Drupal\svg_image\Plugin\Field\FieldWidget\SvgImageWidget; /** @@ -21,6 +22,7 @@ function svg_image_field_widget_info_alter(array &$info) { */ function svg_image_field_formatter_info_alter(array &$info) { $info['image']['class'] = SvgImageFormatter::class; + $info['image_url']['class'] = SvgImageUrlFormatter::class; } /** @@ -33,7 +35,7 @@ function svg_image_field_formatter_info_alter(array &$info) { * @see template_preprocess_image_style() */ function svg_image_preprocess_image_style(array &$variables) { - if (isset($variables['image']['#access']) && !$variables['image']['#access']) { + if (isset($variables['image']['#access']) && !$variables['image']['#access'] && !empty($variables['image']['#uri'])) { $files = \Drupal::entityTypeManager()->getStorage('file') ->loadByProperties(['uri' => $variables['uri']]); if ($files) { @@ -41,7 +43,7 @@ function svg_image_preprocess_image_style(array &$variables) { if (svg_image_is_file_svg($imageFile)) { $variables['image']['#access'] = TRUE; - $variables['image']['#attributes']['class'] = 'no-image-style'; + $variables['image']['#attributes']['class'][] = 'no-image-style'; } } } diff --git a/web/modules/views_infinite_scroll/js/infinite-scroll.js b/web/modules/views_infinite_scroll/js/infinite-scroll.js index 0a66527542e38553c7a72dd1537f5058e899278b..48abbcb92792d653c7b5216c27976fe2cf6d0c97 100644 --- a/web/modules/views_infinite_scroll/js/infinite-scroll.js +++ b/web/modules/views_infinite_scroll/js/infinite-scroll.js @@ -33,6 +33,11 @@ $.fn.infiniteScrollInsertView = function ($newView) { // Extract the view DOM ID from the view classes. var matches = /(js-view-dom-id-\w+)/.exec(this.attr('class')); + + if (!matches) { + return; + } + var currentViewId = matches[1].replace('js-view-dom-id-', 'views_dom_id:'); // Get the existing ajaxViews object. @@ -104,4 +109,19 @@ } }; + /** + * Views AJAX pagination filter. + * + * In case the Entity View Attachment is rendered in a view context, + * the default filter function prevents the required 'Use AJAX' setting + * to work. + * + * @return {Boolean} + * Whether to apply the Views AJAX paginator. VIS requires this setting + * for pagination. + */ + Drupal.views.ajaxView.prototype.filterNestedViews = function () { + return this.$view.hasClass('view-eva') || !this.$view.parents('.view').length; + }; + })(jQuery, Drupal, Drupal.debounce); diff --git a/web/modules/views_infinite_scroll/src/EventSubscriber/AjaxResponseSubscriber.php b/web/modules/views_infinite_scroll/src/EventSubscriber/AjaxResponseSubscriber.php index 040410ebe18c4ad035ec36bf5387fb9c8a6a76b9..4cd796982522e376983cac223df65147afac5658 100644 --- a/web/modules/views_infinite_scroll/src/EventSubscriber/AjaxResponseSubscriber.php +++ b/web/modules/views_infinite_scroll/src/EventSubscriber/AjaxResponseSubscriber.php @@ -49,7 +49,10 @@ public function onResponse(FilterResponseEvent $event) { $view = $response->getView(); // Only alter commands if the user has selected our pager and it attempting // to move beyond page 0. - if ($view->getPager()->getPluginId() !== 'infinite_scroll' || $event->getRequest()->query->get('page') == 0) { + if ($view->getPager()->getPluginId() !== 'infinite_scroll' || + $view->getCurrentPage() === 0 || + $view->getPager()->getCurrentPage() === 0 + ) { // When the current page is 0 it might be the case that there where no // additional items in this case we want to still append the empty result. return; diff --git a/web/modules/views_infinite_scroll/views_infinite_scroll.info.yml b/web/modules/views_infinite_scroll/views_infinite_scroll.info.yml index 6e8c4a2cb9b5b6195793f8cbbbbd02f634a9af8f..7ca3ca3bef1d6617cabac540c141aaf9ae6faa70 100644 --- a/web/modules/views_infinite_scroll/views_infinite_scroll.info.yml +++ b/web/modules/views_infinite_scroll/views_infinite_scroll.info.yml @@ -7,7 +7,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - drupal:views -# Information added by Drupal.org packaging script on 2021-03-05 -version: '8.x-1.8' +# Information added by Drupal.org packaging script on 2021-09-23 +version: '8.x-1.9' project: 'views_infinite_scroll' -datestamp: 1614959014 +datestamp: 1632421789 diff --git a/web/modules/views_infinite_scroll/views_infinite_scroll.module b/web/modules/views_infinite_scroll/views_infinite_scroll.module index 38b35375b2e7c18132a072cb87529512eeb17cf5..1362c17e5f47ae402be5564748c7b05f1c5bfc73 100644 --- a/web/modules/views_infinite_scroll/views_infinite_scroll.module +++ b/web/modules/views_infinite_scroll/views_infinite_scroll.module @@ -52,3 +52,12 @@ function views_infinite_scroll_preprocess_views_view(&$vars) { } } } + +/** + * Implements hook_preprocess_eva_display_entity_view() + */ +function views_infinite_scroll_preprocess_eva_display_entity_view(&$vars) { + // When the contributed EVA module is used to display the View, apply the + // preprocessing logic of this module. + views_infinite_scroll_preprocess_views_view($vars); +}