From 489bb7ec71bd5d6093e786d1c2fc8efa20c4e39c Mon Sep 17 00:00:00 2001 From: Daniel Mundra Date: Wed, 1 Jan 2025 15:43:05 +0000 Subject: [PATCH] Updated dependencies and tragedy commons. --- composer.lock | 118 +++++++++--------- .../tragedy_commons/.cspell-project-words.txt | 1 + modules/tragedy_commons/.ddev/config.yaml | 29 ++--- modules/tragedy_commons/README.md | 15 +-- modules/tragedy_commons/composer.json | 3 +- .../src/Controller/GameController.php | 3 +- .../tragedy_commons/src/Form/RoundsForm.php | 12 +- .../tragedy_commons/tragedy_commons.info.yml | 6 +- 8 files changed, 91 insertions(+), 96 deletions(-) diff --git a/composer.lock b/composer.lock index 329b164de..5126152dc 100644 --- a/composer.lock +++ b/composer.lock @@ -1894,17 +1894,17 @@ }, { "name": "drupal/tragedy_commons", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://git.drupalcode.org/project/tragedy_commons.git", - "reference": "1.0.4" + "reference": "1.0.5" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/tragedy_commons-1.0.4.zip", - "reference": "1.0.4", - "shasum": "efc72461cc89946bb2ab5c6689fd1536a4d8fbd5" + "url": "https://ftp.drupal.org/files/projects/tragedy_commons-1.0.5.zip", + "reference": "1.0.5", + "shasum": "1f7be1e8c075e3250c0b12399cc97fff15b59c41" }, "require": { "drupal/core": "^10 || ^11" @@ -1915,8 +1915,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "1.0.4", - "datestamp": "1730428673", + "version": "1.0.5", + "datestamp": "1735077884", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2090,16 +2090,16 @@ }, { "name": "egulias/email-validator", - "version": "4.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" + "reference": "b115554301161fa21467629f1e1391c1936de517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", - "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517", + "reference": "b115554301161fa21467629f1e1391c1936de517", "shasum": "" }, "require": { @@ -2145,7 +2145,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.3" }, "funding": [ { @@ -2153,7 +2153,7 @@ "type": "github" } ], - "time": "2023-10-06T06:47:41+00:00" + "time": "2024-12-27T00:36:43+00:00" }, { "name": "grasmash/expander", @@ -3042,16 +3042,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -3094,9 +3094,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "pear/archive_tar", @@ -4423,12 +4423,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4646,12 +4646,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4770,16 +4770,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -4814,7 +4814,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.0" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -4830,20 +4830,20 @@ "type": "tidelift" } ], - "time": "2024-10-23T06:56:12+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/http-foundation", - "version": "v7.2.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e88a66c3997859532bc2ddd6dd8f35aba2711744" + "reference": "62d1a43796ca3fea3f83a8470dfe63a4af3bc588" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e88a66c3997859532bc2ddd6dd8f35aba2711744", - "reference": "e88a66c3997859532bc2ddd6dd8f35aba2711744", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/62d1a43796ca3fea3f83a8470dfe63a4af3bc588", + "reference": "62d1a43796ca3fea3f83a8470dfe63a4af3bc588", "shasum": "" }, "require": { @@ -4892,7 +4892,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.2.0" + "source": "https://github.com/symfony/http-foundation/tree/v7.2.2" }, "funding": [ { @@ -4908,20 +4908,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T18:58:46+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.2.1", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "d8ae58eecae44c8e66833e76cc50a4ad3c002d97" + "reference": "3c432966bd8c7ec7429663105f5a02d7e75b4306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d8ae58eecae44c8e66833e76cc50a4ad3c002d97", - "reference": "d8ae58eecae44c8e66833e76cc50a4ad3c002d97", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3c432966bd8c7ec7429663105f5a02d7e75b4306", + "reference": "3c432966bd8c7ec7429663105f5a02d7e75b4306", "shasum": "" }, "require": { @@ -5006,7 +5006,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.2.1" + "source": "https://github.com/symfony/http-kernel/tree/v7.2.2" }, "funding": [ { @@ -5022,7 +5022,7 @@ "type": "tidelift" } ], - "time": "2024-12-11T12:09:10+00:00" + "time": "2024-12-31T14:59:40+00:00" }, { "name": "symfony/mailer", @@ -6168,12 +6168,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -6333,12 +6333,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -6394,16 +6394,16 @@ }, { "name": "symfony/validator", - "version": "v7.2.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "ddad20aa8cf7a45a9d6300e5776b8d252dc3524b" + "reference": "5c01f00fed258a987ef35f0fefcc069f84111cb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/ddad20aa8cf7a45a9d6300e5776b8d252dc3524b", - "reference": "ddad20aa8cf7a45a9d6300e5776b8d252dc3524b", + "url": "https://api.github.com/repos/symfony/validator/zipball/5c01f00fed258a987ef35f0fefcc069f84111cb4", + "reference": "5c01f00fed258a987ef35f0fefcc069f84111cb4", "shasum": "" }, "require": { @@ -6471,7 +6471,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v7.2.0" + "source": "https://github.com/symfony/validator/tree/v7.2.2" }, "funding": [ { @@ -6487,7 +6487,7 @@ "type": "tidelift" } ], - "time": "2024-11-27T09:50:52+00:00" + "time": "2024-12-30T18:35:15+00:00" }, { "name": "symfony/var-dumper", diff --git a/modules/tragedy_commons/.cspell-project-words.txt b/modules/tragedy_commons/.cspell-project-words.txt index 385fda621..c2bbd5a06 100644 --- a/modules/tragedy_commons/.cspell-project-words.txt +++ b/modules/tragedy_commons/.cspell-project-words.txt @@ -31,3 +31,4 @@ partlines mitchella mitchellb mitchellc +varchar diff --git a/modules/tragedy_commons/.ddev/config.yaml b/modules/tragedy_commons/.ddev/config.yaml index bbf7abc7a..f872714cf 100644 --- a/modules/tragedy_commons/.ddev/config.yaml +++ b/modules/tragedy_commons/.ddev/config.yaml @@ -8,7 +8,7 @@ additional_hostnames: [] additional_fqdns: [] database: type: mariadb - version: "10.4" + version: "10.11" use_dns_when_possible: true composer_version: "2" web_environment: @@ -28,7 +28,7 @@ corepack_enable: false # docroot: # Relative path to the directory containing index.php. -# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" +# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" # You can explicitly specify the webimage but this # is not recommended, as the images are often closely tied to DDEV's' behavior, @@ -39,8 +39,9 @@ corepack_enable: false # database: # type: # mysql, mariadb, postgres # version: # database version, like "10.11" or "8.0" -# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 -# PostgreSQL versions can be 9-16. +# MariaDB versions can be 5.5-10.8, 10.11, and 11.4. +# MySQL versions can be 5.5-8.0. +# PostgreSQL versions can be 9-17. # router_http_port: # Port to be used for http (defaults to global configuration, usually 80) # router_https_port: # Port for https (defaults to global configuration, usually 443) @@ -58,6 +59,8 @@ corepack_enable: false # webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn # timezone: Europe/Berlin +# If timezone is unset, DDEV will attempt to derive it from the host system timezone +# using the $TZ environment variable or the /etc/localtime symlink. # This is the timezone used in the containers and by PHP; # it can be set to any valid timezone, # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones @@ -77,16 +80,14 @@ corepack_enable: false # - preview # - snapshot # Alternatively, an explicit Composer version may be specified, for example "2.2.18". -# To reinstall Composer after the image was built, run "ddev debug refresh". +# To reinstall Composer after the image was built, run "ddev debug rebuild". # nodejs_version: "20" # change from the default system Node.js version to any other version. -# Numeric version numbers can be complete (i.e. 18.15.0) or -# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with -# other named releases. -# see https://www.npmjs.com/package/n#specifying-nodejs-versions -# Note that you can continue using 'ddev nvm' or nvm inside the web container -# to change the project's installed node version if you need to. +# See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information +# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation, +# Note that using of 'ddev nvm' is discouraged because "nodejs_version" is much easier to use, +# can specify any version, and is more robust than using 'nvm'. # corepack_enable: false # Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm @@ -202,13 +203,13 @@ corepack_enable: false # disable_settings_management: false # If true, DDEV will not create CMS-specific settings files like -# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php +# Drupal's settings.php/settings.ddev.php or TYPO3's additional.php # In this case the user must provide all such settings. # You can inject environment variables into the web container with: # web_environment: -# - SOMEENV=somevalue -# - SOMEOTHERENV=someothervalue +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue # no_project_mount: false # (Experimental) If true, DDEV will not mount the project into the web container; diff --git a/modules/tragedy_commons/README.md b/modules/tragedy_commons/README.md index edf03c48d..5ac2956e0 100644 --- a/modules/tragedy_commons/README.md +++ b/modules/tragedy_commons/README.md @@ -3,31 +3,20 @@ Provides games that illustrate the tragedy of the commons, made famous by [Garrett Hardin in 1968 in Science magazine](https://www.jstor.org/stable/1724745). -Game code created originally by [Ronald B. Mitchell](https://ronaldbmitchell.com/). +Game code created originally by [Ronald B. Mitchell](https://ronaldbmitchell.com/commons/). Drupal core created by [Daniel Mundra](https://www.drupal.org/u/dmundra). -## Table of contents - -- Installation -- Configuration -- Maintainers -- Developer Documentation - ## Installation Install as you would normally install a contributed Drupal module. For further information, see [Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules). -## Configuration - - ## Maintainers - Daniel Mundra - [dmundra](https://www.drupal.org/u/dmundra) -CONTRIBUTING ------------- +## Contributing See [CONTRIBUTING](./CONTRIBUTING.md). diff --git a/modules/tragedy_commons/composer.json b/modules/tragedy_commons/composer.json index d571d47d7..938f8a789 100644 --- a/modules/tragedy_commons/composer.json +++ b/modules/tragedy_commons/composer.json @@ -16,7 +16,8 @@ "dealerdirect/phpcodesniffer-composer-installer": true, "phpstan/extension-installer": true, "cweagans/composer-patches": true, - "drupal/core-composer-scaffold": true + "drupal/core-composer-scaffold": true, + "tbachert/spi": true } }, "require-dev": { diff --git a/modules/tragedy_commons/src/Controller/GameController.php b/modules/tragedy_commons/src/Controller/GameController.php index 73137f0d2..5d951396f 100644 --- a/modules/tragedy_commons/src/Controller/GameController.php +++ b/modules/tragedy_commons/src/Controller/GameController.php @@ -648,7 +648,8 @@ public function results($gid) { ]; $commons = ''; - $tens = substr($all_animals, 0, -1); + echo $all_animals; + $tens = $all_animals > 9 ? substr($all_animals, 0, -1) : 0; $ones = substr($all_animals, -1); $fulllines = $tens / 2; if (substr($fulllines, -2) == '.5') { diff --git a/modules/tragedy_commons/src/Form/RoundsForm.php b/modules/tragedy_commons/src/Form/RoundsForm.php index e21f5d968..d2ef3480f 100644 --- a/modules/tragedy_commons/src/Form/RoundsForm.php +++ b/modules/tragedy_commons/src/Form/RoundsForm.php @@ -150,11 +150,13 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // Enable names for any previous rounds if provided. if (is_array($rounds_with_names)) { foreach ($rounds_with_names as $round_number_to_update) { - $this->database->update('tragedy_commons_multi_round') - ->fields(['show_names' => 1]) - ->condition('gid', $request->gid) - ->condition('round_number', $round_number_to_update) - ->execute(); + if (!empty($round_number_to_update)) { + $this->database->update('tragedy_commons_multi_round') + ->fields(['show_names' => 1]) + ->condition('gid', $request->gid) + ->condition('round_number', $round_number_to_update) + ->execute(); + } } } else { diff --git a/modules/tragedy_commons/tragedy_commons.info.yml b/modules/tragedy_commons/tragedy_commons.info.yml index ded08b2a1..fed9a8cd2 100644 --- a/modules/tragedy_commons/tragedy_commons.info.yml +++ b/modules/tragedy_commons/tragedy_commons.info.yml @@ -5,7 +5,7 @@ configure: tragedy_commons.config_form core_version_requirement: ^10 || ^11 package: Development -# Information added by Drupal.org packaging script on 2024-11-01 -version: '1.0.4' +# Information added by Drupal.org packaging script on 2024-12-24 +version: '1.0.5' project: 'tragedy_commons' -datestamp: 1730428675 +datestamp: 1735077887