From b358ecc226f9bf9ff6219489760bcef4a3c926ef Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Thu, 5 Oct 2023 10:56:04 +0200 Subject: [PATCH 01/15] Fixed a bug where webprofiler coudnt work --- composer.json | 1 + composer.lock | 619 +++++++++++++++++- .../src/Helper/Helper.php | 4 +- .../src/Helper/Helper.php | 4 +- 4 files changed, 623 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 460bee63..5fb22267 100755 --- a/composer.json +++ b/composer.json @@ -135,6 +135,7 @@ "drupal/views_data_export": "^1.3", "drupal/viewsreference": "^1.2", "drupal/webform": "^6.1", + "drupal/webprofiler": "^9.0", "drupal/xls_serialization": "^1.2", "drush/drush": "^11", "itk-dev/composer-virtualenv": "^1.0", diff --git a/composer.lock b/composer.lock index 096ad6e5..1dbca909 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": "dc923de4e7019b803b580fbca6c8ac0f", + "content-hash": "19e99cd5e4d2dc278c7fa1c7dcb7ddff", "packages": [ { "name": "asm89/stack-cors", @@ -1242,6 +1242,105 @@ }, "time": "2022-07-02T10:48:51+00:00" }, + { + "name": "doctrine/cache", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "56cd022adb5514472cb144c087393c1821911d09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09", + "reference": "56cd022adb5514472cb144c087393c1821911d09", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/1.13.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:06:54+00:00" + }, { "name": "doctrine/collections", "version": "1.8.0", @@ -1312,6 +1411,107 @@ }, "time": "2022-09-01T20:12:10+00:00" }, + { + "name": "doctrine/common", + "version": "2.13.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "f3812c026e557892c34ef37f6ab808a6b567da7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/f3812c026e557892c34ef37f6ab808a6b567da7f", + "reference": "f3812c026e557892c34ef37f6ab808a6b567da7f", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/inflector": "^1.0", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^1.3.3", + "doctrine/reflection": "^1.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^1.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^4.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, proxies, event system and much more.", + "homepage": "https://www.doctrine-project.org/projects/common.html", + "keywords": [ + "common", + "doctrine", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/2.13.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", + "type": "tidelift" + } + ], + "time": "2020-06-05T16:46:05+00:00" + }, { "name": "doctrine/deprecations", "version": "v1.1.1", @@ -1359,6 +1559,194 @@ }, "time": "2023-06-03T09:27:29+00:00" }, + { + "name": "doctrine/event-manager", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:51:15+00:00" + }, + { + "name": "doctrine/inflector", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/1.4.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-04-16T17:34:40+00:00" + }, { "name": "doctrine/instantiator", "version": "2.0.0", @@ -1505,6 +1893,108 @@ ], "time": "2022-02-28T11:07:21+00:00" }, + { + "name": "doctrine/persistence", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "7a6eac9fb6f61bba91328f15aa7547f4806ca288" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/7a6eac9fb6f61bba91328f15aa7547f4806ca288", + "reference": "7a6eac9fb6f61bba91328f15aa7547f4806ca288", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/reflection": "^1.2", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.10@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^3.11" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common", + "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", + "homepage": "https://doctrine-project.org/projects/persistence.html", + "keywords": [ + "mapper", + "object", + "odm", + "orm", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/1.3.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence", + "type": "tidelift" + } + ], + "time": "2020-06-20T12:56:16+00:00" + }, { "name": "doctrine/reflection", "version": "1.2.4", @@ -2803,6 +3293,73 @@ "issues": "https://www.drupal.org/project/issues/ctools" } }, + { + "name": "drupal/devel", + "version": "5.1.2", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/devel.git", + "reference": "5.1.2" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/devel-5.1.2.zip", + "reference": "5.1.2", + "shasum": "9b35e38bf2043bf87f88585b3d9100f38da8f07f" + }, + "require": { + "doctrine/common": "^2.7 || ^3.4", + "drupal/core": "^9 || ^10", + "php": ">=7.4", + "symfony/var-dumper": "^4 || ^5 || ^6" + }, + "conflict": { + "kint-php/kint": "<3" + }, + "require-dev": { + "drush/drush": "^11" + }, + "suggest": { + "kint-php/kint": "Kint provides an informative display of arrays/objects. Useful for debugging and developing." + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "5.1.2", + "datestamp": "1686161028", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9 || ^10 || ^11" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "drupalspoons", + "homepage": "https://www.drupal.org/user/3647684" + }, + { + "name": "moshe weitzman", + "homepage": "https://www.drupal.org/user/23" + } + ], + "description": "Various blocks, pages, and functions for developers.", + "homepage": "https://www.drupal.org/project/devel", + "support": { + "source": "https://gitlab.com/drupalspoons/devel", + "issues": "https://gitlab.com/drupalspoons/devel/-/issues", + "slack": "https://drupal.slack.com/archives/C012WAW1MH6" + } + }, { "name": "drupal/ds", "version": "3.15.0", @@ -5277,6 +5834,64 @@ "forum": "https://drupal.stackexchange.com/questions/tagged/webform" } }, + { + "name": "drupal/webprofiler", + "version": "9.0.2", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/webprofiler.git", + "reference": "9.0.2" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/webprofiler-9.0.2.zip", + "reference": "9.0.2", + "shasum": "b9f168af37090e8435fb8134c694f7d0f511ff61" + }, + "require": { + "doctrine/common": "^2.7", + "drupal/core": "^8.8 || ^9", + "drupal/devel": "*", + "symfony/var-dumper": "^4 || ^5" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "9.0.2", + "datestamp": "1665128594", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Luca Lusso", + "homepage": "https://github.com/lussoluca", + "email": "lussoluca@gmail.com", + "role": "Maintainer" + }, + { + "name": "drupalspoons", + "homepage": "https://www.drupal.org/user/3647684" + }, + { + "name": "lussoluca", + "homepage": "https://www.drupal.org/user/138068" + } + ], + "description": "Drupal Webprofiler.", + "homepage": "https://www.drupal.org/project/webprofiler", + "support": { + "source": "https://gitlab.com/drupalspoons/webprofiler", + "issues": "https://gitlab.com/drupalspoons/webprofiler/-/issues" + } + }, { "name": "drupal/xls_serialization", "version": "1.3.0", @@ -17784,5 +18399,5 @@ "php": "^8.1.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php b/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php index ad67157f..f11f9000 100644 --- a/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php +++ b/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php @@ -13,6 +13,7 @@ use Drupal\Core\Messenger\MessengerTrait; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Site\Settings; +use Drupal\Core\State\StateInterface; use Drupal\Core\State\State; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\TempStore\PrivateTempStore; @@ -27,6 +28,7 @@ use Psr\Log\LoggerTrait; use Symfony\Component\Serializer\Serializer; + /** * A helper class for the module. */ @@ -48,7 +50,7 @@ class Helper implements LoggerAwareInterface { public function __construct( readonly private PrivateTempStoreFactory $tempStoreFactory, readonly private Serializer $serializer, - readonly private State $state, + readonly private StateInterface $state, readonly private FileUrlGenerator $fileUrlGenerator, readonly private RouteMatchInterface $routeMatch, readonly private Connection $connection, diff --git a/web/modules/custom/hoeringsportal_citizen_proposal_archiving/src/Helper/Helper.php b/web/modules/custom/hoeringsportal_citizen_proposal_archiving/src/Helper/Helper.php index 2c209c06..68443a16 100644 --- a/web/modules/custom/hoeringsportal_citizen_proposal_archiving/src/Helper/Helper.php +++ b/web/modules/custom/hoeringsportal_citizen_proposal_archiving/src/Helper/Helper.php @@ -5,7 +5,7 @@ use Drupal\advancedqueue\Entity\QueueInterface; use Drupal\advancedqueue\Job; use Drupal\advancedqueue\JobResult; -use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\entity_events\EntityEventType; @@ -34,7 +34,7 @@ final class Helper implements EventSubscriberInterface, LoggerAwareInterface, Lo * * @var \Drupal\Core\Config\Entity\ConfigEntityStorage|\Drupal\Core\Entity\EntityStorageInterface */ - protected ConfigEntityStorage $queueStorage; + protected ConfigEntityStorageInterface $queueStorage; /** * Constructor. From aa934365443b9acb7280121a8b75afd80e12de31 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Mon, 9 Oct 2023 09:47:41 +0200 Subject: [PATCH 02/15] created PublicMeetingFixture --- .../hoeringsportal_base_fixtures.services.yml | 8 ++- .../src/Fixture/PublicMeetingFixture.php | 64 +++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php diff --git a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml index 5aaf5040..a3dfb278 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml +++ b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml @@ -40,5 +40,9 @@ services: Drupal\hoeringsportal_base_fixtures\Fixture\MenuItemFixture: tags: - { name: content_fixture } - arguments: - - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' + + Drupal\hoeringsportal_base_fixtures\Fixture\PublicMeetingFixture: + tags: + - { name: content_fixture } + arguments: + - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php new file mode 100644 index 00000000..ab849ea1 --- /dev/null +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -0,0 +1,64 @@ + 'public_meeting', + 'title' => 'public_meeting - Heste Meeting', + 'status' => NodeInterface::PUBLISHED, + "field_area" => ['tid' => date("Y-m-d", 1283166912) ], +// "field_cancelled_date" => 'field_cancelled_date' , +// "field_cancelled_text" => 'field_cancelled_text' , +// "field_contact" => 'field_contact' , +// "field_content_state" => 'field_content_state' , +// "field_description" => 'field_description' , +// "field_email_address" => 'a@a.dk' , +//// "field_first_meeting_time" => 'field_first_meeting_time' , datao +// "field_hidden_signup" => 'field_hidden_signup' , +//// "field_last_meeting_time" => 'field_last_meeting_time' , +// "field_last_meeting_time_end" => 'field_last_meeting_time_end' , +// "field_map" => 'field_map' , +//// "field_media_document" => 'field_media_document' , +//// "field_media_image_single" => 'field_media_image_single' , +//// "field_pretix_dates" => 'field_pretix_dates' , +"field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], + "field_email" => 'parent@test.dk ', +//// "field_project_reference" => 'field_project_reference' , +// "field_public_meeting_cancelled" => 'field_public_meeting_cancelled', +// "field_registration_deadline" => 'field_registration_deadline', +//// "field_section" => 'field_section' , +// "field_signup_link" => 'field_signup_link' , +// "field_signup_selection" => 'field_signup_selection' , +// "field_signup_text" => 'field_signup_text' , +// "field_teaser" => 'field_teaser' , +// "field_type" => 'field_type' , + ]); + $this->addReference('public_meeting:fixture-1', $node); + $node->save(); + } + + /** + * {@inheritdoc} + */ + public function getGroups() { + return ['nodes']; + } + +} From b5617a365b64fcf8bdd69707d361ca7d1b8b9aaf Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Mon, 9 Oct 2023 13:30:09 +0200 Subject: [PATCH 03/15] HRN-756 updated PublicMeetingFixture --- .../src/Fixture/PublicMeetingFixture.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index ab849ea1..49f6125f 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -23,17 +23,17 @@ public function load() { 'type' => 'public_meeting', 'title' => 'public_meeting - Heste Meeting', 'status' => NodeInterface::PUBLISHED, - "field_area" => ['tid' => date("Y-m-d", 1283166912) ], -// "field_cancelled_date" => 'field_cancelled_date' , -// "field_cancelled_text" => 'field_cancelled_text' , -// "field_contact" => 'field_contact' , -// "field_content_state" => 'field_content_state' , -// "field_description" => 'field_description' , -// "field_email_address" => 'a@a.dk' , -//// "field_first_meeting_time" => 'field_first_meeting_time' , datao -// "field_hidden_signup" => 'field_hidden_signup' , -//// "field_last_meeting_time" => 'field_last_meeting_time' , -// "field_last_meeting_time_end" => 'field_last_meeting_time_end' , + "field_area" => ['tid' => date("Y-m-d", 2222222322222) ], + "field_cancelled_date" => date("Y-m-d", 1283166912), + "field_cancelled_text" => 'field_cancelled_text' , + "field_contact" => 'field_contact' , + "field_content_state" => 'active' , + "field_description" => 'field_description' , + "field_email_address" => 'a@a.dk' , + "field_first_meeting_time" => date("Y-m-d", 1283166912) , + "field_hidden_signup" => 4 , + "field_last_meeting_time" => date("Y-m-d", 1283166912) , + "field_last_meeting_time_end" => date("Y-m-d", 2222222322222) , // "field_map" => 'field_map' , //// "field_media_document" => 'field_media_document' , //// "field_media_image_single" => 'field_media_image_single' , From 70b262fdeb4418d9013837b6502b90be665b8750 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Wed, 11 Oct 2023 10:38:21 +0200 Subject: [PATCH 04/15] HRN-756 updated Fixture --- .../src/Fixture/PublicMeetingFixture.php | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index 49f6125f..d7034dfe 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -3,6 +3,7 @@ namespace Drupal\hoeringsportal_base_fixtures\Fixture; use Drupal\content_fixtures\Fixture\AbstractFixture; +use Drupal\content_fixtures\Fixture\DependentFixtureInterface; use Drupal\content_fixtures\Fixture\FixtureGroupInterface; use Drupal\node\Entity\Node; use Drupal\node\NodeInterface; @@ -12,7 +13,7 @@ * * @package Drupal\hoeringsportal_base_fixtures\Fixture */ -class PublicMeetingFixture extends AbstractFixture implements FixtureGroupInterface { +class PublicMeetingFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { /** * {@inheritdoc} @@ -35,15 +36,20 @@ public function load() { "field_last_meeting_time" => date("Y-m-d", 1283166912) , "field_last_meeting_time_end" => date("Y-m-d", 2222222322222) , // "field_map" => 'field_map' , -//// "field_media_document" => 'field_media_document' , -//// "field_media_image_single" => 'field_media_image_single' , + "field_media_document" => ['target_id' => $this->getReference('media_library:Fil:MTM')->id()], + "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()] , //// "field_pretix_dates" => 'field_pretix_dates' , -"field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], + "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], "field_email" => 'parent@test.dk ', -//// "field_project_reference" => 'field_project_reference' , -// "field_public_meeting_cancelled" => 'field_public_meeting_cancelled', -// "field_registration_deadline" => 'field_registration_deadline', -//// "field_section" => 'field_section' , + "field_project_reference" => 'field_project_reference' , + + // "field_public_meeting_cancelled" => 'field_public_meeting_cancelled', Warning: file_get_contents(themes/custom/hoeringsportal/build/hoeringsportal.js) + "field_registration_deadline" => ['value' => 'word' ] , + 'field_section' => + [ + 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), + 'target_revision_id' => $this->getReference('paragraph:content_list:content_list1')->getRevisionId(), + ], // "field_signup_link" => 'field_signup_link' , // "field_signup_selection" => 'field_signup_selection' , // "field_signup_text" => 'field_signup_text' , @@ -54,6 +60,16 @@ public function load() { $node->save(); } + /** + * {@inheritdoc} + */ + public function getDependencies() { + return [ + MediaFixture::class, + ParagraphFixture::class, + ]; + } + /** * {@inheritdoc} */ From 64e04244aa60b7b62147427965a555097380a45a Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Wed, 11 Oct 2023 13:59:07 +0200 Subject: [PATCH 05/15] HRN-756 Updated Fixture --- .../src/Fixture/ParagraphFixture.php | 14 ++++++++++++++ .../src/Fixture/PublicMeetingFixture.php | 17 +++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php index 1df3bc3a..1526f85e 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php @@ -18,6 +18,20 @@ class ParagraphFixture extends AbstractFixture implements DependentFixtureInterf * {@inheritdoc} */ public function load() { + + $paragraph = Paragraph::create([ + 'type' => 'signup_link', + 'field_signup_link' => [ + [ + + "field_signup_link_uri" => ['title' => 'mmmmm', 'field_signup_link_options' => ['value' =>'test']] + + ], + ], + ]); + $paragraph->save(); + $this->addReference('paragraph:link1', $paragraph); + $paragraph = Paragraph::create([ 'type' => 'image', 'field_paragraph_image' => [ diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index d7034dfe..3705974d 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -34,7 +34,7 @@ public function load() { "field_first_meeting_time" => date("Y-m-d", 1283166912) , "field_hidden_signup" => 4 , "field_last_meeting_time" => date("Y-m-d", 1283166912) , - "field_last_meeting_time_end" => date("Y-m-d", 2222222322222) , + "field_last_meeting_time_end" => date("Y-m-d", 2222222322222), // "field_map" => 'field_map' , "field_media_document" => ['target_id' => $this->getReference('media_library:Fil:MTM')->id()], "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()] , @@ -42,19 +42,20 @@ public function load() { "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], "field_email" => 'parent@test.dk ', "field_project_reference" => 'field_project_reference' , - // "field_public_meeting_cancelled" => 'field_public_meeting_cancelled', Warning: file_get_contents(themes/custom/hoeringsportal/build/hoeringsportal.js) - "field_registration_deadline" => ['value' => 'word' ] , + "field_registration_deadline" => ['value' => 'word'], 'field_section' => [ 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), 'target_revision_id' => $this->getReference('paragraph:content_list:content_list1')->getRevisionId(), ], -// "field_signup_link" => 'field_signup_link' , -// "field_signup_selection" => 'field_signup_selection' , -// "field_signup_text" => 'field_signup_text' , -// "field_teaser" => 'field_teaser' , -// "field_type" => 'field_type' , + "field_signup_link" => $this->getReference('paragraph:link1')->id(), // Virker ikke blob ? + "field_signup_selection" => 'field_signup_selection' , + "field_signup_text" => 'field_signup_text' , + "field_teaser" => 'field_teaser' , + "field_type" => [ + "taxonomy_index" => + ["tid" => 1283166912]] // ingen fejl men vises ikke i db ]); $this->addReference('public_meeting:fixture-1', $node); $node->save(); From 27679fa3dde05a73338cbf91219ef281bba09ec0 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Thu, 12 Oct 2023 10:07:17 +0200 Subject: [PATCH 06/15] HRN-756 Updated fixture, created Mapfixture and wire it to services.yml --- .../hoeringsportal_base_fixtures.services.yml | 5 ++ .../src/Fixture/MapFixture.php | 53 +++++++++++++++++++ .../src/Fixture/PublicMeetingFixture.php | 8 +-- 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php diff --git a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml index a3dfb278..9db919d9 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml +++ b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml @@ -46,3 +46,8 @@ services: - { name: content_fixture } arguments: - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' + Drupal\hoeringsportal_base_fixtures\Fixture\MapFixture: + tags: + - { name: content_fixture } + arguments: + - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php new file mode 100644 index 00000000..f832e9a6 --- /dev/null +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php @@ -0,0 +1,53 @@ + 'public_meeting', + 'title' => 'public_meeting - Heste Meeting', + 'status' => NodeInterface::PUBLISHED, + "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], + // "field_map_configuration" => 'field_map_configuration', + //: "field_map_type" => '' + + ]); + $this->addReference('page_map:fixture-1', $node); + $node->save(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() { + return [ + MediaFixture::class, + ParagraphFixture::class, + ]; + } + + /** + * {@inheritdoc} + */ + public function getGroups() { + return ['nodes']; + } + +} diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index 3705974d..6537f9a3 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -49,13 +49,13 @@ public function load() { 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), 'target_revision_id' => $this->getReference('paragraph:content_list:content_list1')->getRevisionId(), ], - "field_signup_link" => $this->getReference('paragraph:link1')->id(), // Virker ikke blob ? +// "field_signup_link" => $this->getReference('paragraph:link1')->id(), // Virker ikke blob ? "field_signup_selection" => 'field_signup_selection' , "field_signup_text" => 'field_signup_text' , "field_teaser" => 'field_teaser' , - "field_type" => [ - "taxonomy_index" => - ["tid" => 1283166912]] // ingen fejl men vises ikke i db + // "field_type" => [ + // "taxonomy_index" => + // ["tid" => 1283166912]] // ingen fejl men vises ikke i db ]); $this->addReference('public_meeting:fixture-1', $node); $node->save(); From bcb84e69b4697a3a8f1aa3fcb1758173467a2cdd Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Thu, 12 Oct 2023 13:08:31 +0200 Subject: [PATCH 07/15] HRN-756 updated Mapfixture, it can now show an map from json data --- .../src/Fixture/MapFixture.php | 62 ++++++++++++++++--- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php index f832e9a6..d5635e76 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php @@ -15,20 +15,68 @@ */ class MapFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { + + /** * {@inheritdoc} */ public function load() { + + $field_map_configuration_data = [ + "map" => [ + "maxZoomLevel" => 0, + "minZoomLevel" => 20, + "view" => [ + "zoomLevel" => 5, + "x" => 659519, + "y" => 6151191, + ], + "layer" => [ + [ + "namedlayer" => "#dk_standard", + ], + [ + "features" => true, + "features_host" => "../data/boernehaver.json", + "features_dataType" => "json", + "features_type" => "Point", + "features_style" => [ + "namedstyle" => "#011", + ], + "template_info" => "
{{navn}}
<% if (navn === 'Landsbybørnehaven') { %>
<%= navn %>
<% } %>
{{Adresse}}, {{Postnr}} {{By}}
<% if (navn === 'Regnbuen') { %>
Dette er en meget lang tekst hvor der kan stå en masse, men det er ikke sikkert at der er plads til det på kortet
<% } %>
", + "name" => "Børnehaver", + "type" => "geojson", + ], + ], + "controls" => [ + [ + "info" => [ + "disable" => false, + "eventtype" => "click", + "multifeature" => 10, + "type" => "cloud", + ], + "overlay" => [ + "disable" => false, + ], + ], + ], + ], + ]; + $node = Node::create([ - 'type' => 'public_meeting', - 'title' => 'public_meeting - Heste Meeting', + 'type' => 'page_map', + 'title' => 'page_map - Heste Kortet', 'status' => NodeInterface::PUBLISHED, - "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], - // "field_map_configuration" => 'field_map_configuration', - //: "field_map_type" => '' - - ]); + "field_pretix_event_settings" => + [ + 'template_event' => 'testvej 2', + 'synchronize_event' => FALSE, + ], + "field_map_type" => [], + "field_map_configuration" => json_encode($field_map_configuration_data), + ]); $this->addReference('page_map:fixture-1', $node); $node->save(); } From 3c0e96541833b3587af39fcd6bb139292a8fa755 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Thu, 12 Oct 2023 13:41:17 +0200 Subject: [PATCH 08/15] HRN 756 Created new Fixture "ProjectTimeLine" and wired it to services --- .../hoeringsportal_base_fixtures.services.yml | 5 ++ .../src/Fixture/ProjectTimeLineFixture.php | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php diff --git a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml index 9db919d9..c0b2e1e9 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml +++ b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml @@ -51,3 +51,8 @@ services: - { name: content_fixture } arguments: - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' + Drupal\hoeringsportal_base_fixtures\Fixture\ProjectTimeLineFixture: + tags: + - { name: content_fixture } + arguments: + - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php new file mode 100644 index 00000000..29604132 --- /dev/null +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php @@ -0,0 +1,52 @@ + 'project', + 'title' => 'project - Projekt Tidslinje', + 'status' => NodeInterface::PUBLISHED, + + ]); + $this->addReference('project:fixture-1', $node); + $node->save(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() { + return [ + MediaFixture::class, + ParagraphFixture::class, + ]; + } + + /** + * {@inheritdoc} + */ + public function getGroups() { + return ['nodes']; + } + +} From 29f9f69fd84708d199033938801829cbd018ab05 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Mon, 16 Oct 2023 14:30:21 +0200 Subject: [PATCH 09/15] HRN-756 updated Timeline, still dosnt show, but no error --- .../src/Fixture/ParagraphFixture.php | 5 +---- .../src/Fixture/ProjectTimeLineFixture.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php index 1526f85e..35747f0c 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php @@ -23,10 +23,7 @@ public function load() { 'type' => 'signup_link', 'field_signup_link' => [ [ - - "field_signup_link_uri" => ['title' => 'mmmmm', 'field_signup_link_options' => ['value' =>'test']] - - ], + "field_signup_link_uri" => ['title' => 'mmmmm', 'field_signup_link_options' => ['value' => 'test']],], ], ]); $paragraph->save(); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php index 29604132..e434f576 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php @@ -22,11 +22,21 @@ class ProjectTimeLineFixture extends AbstractFixture implements DependentFixtur */ public function load() { + $today = strtotime('today'); + $tenDaysLater = strtotime('+10 days', $today); + + $node = Node::create([ 'type' => 'project', 'title' => 'project - Projekt Tidslinje', 'status' => NodeInterface::PUBLISHED, - + "field_description" => "field_description - Her forklare jeg noget", + "field_project_finish" => date('d-m-Y', $tenDaysLater), + "field_project_start" => date('d-m-Y', $today), + "field_timeline_items" => [ + 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), +// 'target_revision_id' => $this->getReference(''), + ], ]); $this->addReference('project:fixture-1', $node); $node->save(); From e051f2c2f97cfcf825fbdd50a19d1e278dc0c650 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Mon, 16 Oct 2023 15:18:58 +0200 Subject: [PATCH 10/15] HRN-756 added StaticPageFixture --- .../hoeringsportal_base_fixtures.services.yml | 5 ++ .../src/Fixture/StaticPageFixture.php | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php diff --git a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml index c0b2e1e9..c8acf7b0 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml +++ b/web/modules/custom/hoeringsportal_base_fixtures/hoeringsportal_base_fixtures.services.yml @@ -56,3 +56,8 @@ services: - { name: content_fixture } arguments: - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' + Drupal\hoeringsportal_base_fixtures\Fixture\StaticPageFixture: + tags: + - { name: content_fixture } + arguments: + - '@Drupal\hoeringsportal_base_fixtures\Helper\Helper' diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php new file mode 100644 index 00000000..3562f01c --- /dev/null +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -0,0 +1,50 @@ + 'static_page', + 'title' => 'Statisk side 223232323', + 'status' => NodeInterface::PUBLISHED, + ]); + $this->addReference('static_page:fixture-1', $node); + $node->save(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() { + return [ + MediaFixture::class, + ParagraphFixture::class, + ]; + } + + /** + * {@inheritdoc} + */ + public function getGroups() { + return ['nodes']; + } + +} From 21a07ea366543c0d1fbcbbea8139784e213dcd67 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Tue, 17 Oct 2023 08:14:04 +0200 Subject: [PATCH 11/15] HRN -756 Added reaplied coding standards --- .../src/Fixture/MapFixture.php | 9 +++------ .../src/Fixture/ParagraphFixture.php | 7 ++++++- .../src/Fixture/ProjectTimeLineFixture.php | 7 ++----- .../src/Fixture/PublicMeetingFixture.php | 18 +++++++++++------- .../src/Fixture/StaticPageFixture.php | 4 +--- .../src/Helper/Helper.php | 4 +--- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php index d5635e76..07660b6c 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/MapFixture.php @@ -15,14 +15,11 @@ */ class MapFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { - - /** * {@inheritdoc} */ public function load() { - $field_map_configuration_data = [ "map" => [ "maxZoomLevel" => 0, @@ -37,7 +34,7 @@ public function load() { "namedlayer" => "#dk_standard", ], [ - "features" => true, + "features" => TRUE, "features_host" => "../data/boernehaver.json", "features_dataType" => "json", "features_type" => "Point", @@ -52,13 +49,13 @@ public function load() { "controls" => [ [ "info" => [ - "disable" => false, + "disable" => FALSE, "eventtype" => "click", "multifeature" => 10, "type" => "cloud", ], "overlay" => [ - "disable" => false, + "disable" => FALSE, ], ], ], diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php index 35747f0c..e2168e47 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ParagraphFixture.php @@ -23,7 +23,12 @@ public function load() { 'type' => 'signup_link', 'field_signup_link' => [ [ - "field_signup_link_uri" => ['title' => 'mmmmm', 'field_signup_link_options' => ['value' => 'test']],], + "field_signup_link_uri" => + [ + 'title' => 'mmmmm', + 'field_signup_link_options' => ['value' => 'test'], + ], + ], ], ]); $paragraph->save(); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php index e434f576..5dc49062 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php @@ -13,9 +13,7 @@ * * @package Drupal\hoeringsportal_base_fixtures\Fixture */ -class ProjectTimeLineFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { - - +class ProjectTimeLineFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { /** * {@inheritdoc} @@ -25,7 +23,6 @@ public function load() { $today = strtotime('today'); $tenDaysLater = strtotime('+10 days', $today); - $node = Node::create([ 'type' => 'project', 'title' => 'project - Projekt Tidslinje', @@ -35,7 +32,7 @@ public function load() { "field_project_start" => date('d-m-Y', $today), "field_timeline_items" => [ 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), -// 'target_revision_id' => $this->getReference(''), + // 'target_revision_id' => $this->getReference(''), ], ]); $this->addReference('project:fixture-1', $node); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index 6537f9a3..a1118e54 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -24,7 +24,7 @@ public function load() { 'type' => 'public_meeting', 'title' => 'public_meeting - Heste Meeting', 'status' => NodeInterface::PUBLISHED, - "field_area" => ['tid' => date("Y-m-d", 2222222322222) ], + "field_area" => ['tid' => date("Y-m-d", 2222222322222)], "field_cancelled_date" => date("Y-m-d", 1283166912), "field_cancelled_text" => 'field_cancelled_text' , "field_contact" => 'field_contact' , @@ -35,25 +35,29 @@ public function load() { "field_hidden_signup" => 4 , "field_last_meeting_time" => date("Y-m-d", 1283166912) , "field_last_meeting_time_end" => date("Y-m-d", 2222222322222), -// "field_map" => 'field_map' , + // "field_map" => 'field_map' , "field_media_document" => ['target_id' => $this->getReference('media_library:Fil:MTM')->id()], "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()] , -//// "field_pretix_dates" => 'field_pretix_dates' , - "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], + // "field_pretix_dates" => 'field_pretix_dates' , + "field_pretix_event_settings" => + ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], "field_email" => 'parent@test.dk ', "field_project_reference" => 'field_project_reference' , - // "field_public_meeting_cancelled" => 'field_public_meeting_cancelled', Warning: file_get_contents(themes/custom/hoeringsportal/build/hoeringsportal.js) + // "field_public_meeting_cancelled" => + // 'field_public_meeting_cancelled', + // Warning: file_get_contents(themes/custom/hoeringsportal/build/) "field_registration_deadline" => ['value' => 'word'], 'field_section' => [ 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), 'target_revision_id' => $this->getReference('paragraph:content_list:content_list1')->getRevisionId(), ], -// "field_signup_link" => $this->getReference('paragraph:link1')->id(), // Virker ikke blob ? + // "field_signup_link" => $this->getReference('paragraph:link1')->id(), + // // Virker ikke blob ? "field_signup_selection" => 'field_signup_selection' , "field_signup_text" => 'field_signup_text' , "field_teaser" => 'field_teaser' , - // "field_type" => [ + // "field_type" => [ // "taxonomy_index" => // ["tid" => 1283166912]] // ingen fejl men vises ikke i db ]); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php index 3562f01c..e27522ad 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -13,9 +13,7 @@ * * @package Drupal\hoeringsportal_base_fixtures\Fixture */ -class StaticPageFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { - - +class StaticPageFixture extends AbstractFixture implements DependentFixtureInterface, FixtureGroupInterface { /** * {@inheritdoc} diff --git a/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php b/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php index f11f9000..99170ab3 100644 --- a/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php +++ b/web/modules/custom/hoeringsportal_citizen_proposal/src/Helper/Helper.php @@ -14,7 +14,6 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Site\Settings; use Drupal\Core\State\StateInterface; -use Drupal\Core\State\State; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\TempStore\PrivateTempStore; use Drupal\Core\TempStore\PrivateTempStoreFactory; @@ -28,7 +27,6 @@ use Psr\Log\LoggerTrait; use Symfony\Component\Serializer\Serializer; - /** * A helper class for the module. */ @@ -50,7 +48,7 @@ class Helper implements LoggerAwareInterface { public function __construct( readonly private PrivateTempStoreFactory $tempStoreFactory, readonly private Serializer $serializer, - readonly private StateInterface $state, + readonly private StateInterface $state, readonly private FileUrlGenerator $fileUrlGenerator, readonly private RouteMatchInterface $routeMatch, readonly private Connection $connection, From 984193558bf30878250a269b349fc3c906c7ff16 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Tue, 17 Oct 2023 08:53:36 +0200 Subject: [PATCH 12/15] HRN-756 added content to StaticPageFixture --- .../src/Fixture/StaticPageFixture.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php index e27522ad..eeebba40 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -23,6 +23,11 @@ public function load() { 'type' => 'static_page', 'title' => 'Statisk side 223232323', 'status' => NodeInterface::PUBLISHED, + "field_media_image_single" => '', +// "field_section" => '', +// "field_teaser" => '', +// "field_sidebar" => '', +// "field_teaser_color" => '', ]); $this->addReference('static_page:fixture-1', $node); $node->save(); From e13a20c48e3b698aade8c05e347ce5429ed0affb Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Tue, 17 Oct 2023 13:13:13 +0200 Subject: [PATCH 13/15] HRN-756 Updated StaticPage, only missing field_section --- .../src/Fixture/StaticPageFixture.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php index eeebba40..17db3a3e 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -23,11 +23,11 @@ public function load() { 'type' => 'static_page', 'title' => 'Statisk side 223232323', 'status' => NodeInterface::PUBLISHED, - "field_media_image_single" => '', -// "field_section" => '', -// "field_teaser" => '', -// "field_sidebar" => '', -// "field_teaser_color" => '', + "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()], +// "field_section" => [], Hvad er det + "field_teaser" => 'field teaser', + "field_sidebar" => ['value' => 'Sidebar ?'], + "field_teaser_color" => '#fff', ]); $this->addReference('static_page:fixture-1', $node); $node->save(); From 206d37ccf44a557582873c2c614b705cbc810e7b Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Mon, 23 Oct 2023 15:10:19 +0200 Subject: [PATCH 14/15] applied coding standards --- .../src/Fixture/ProjectTimeLineFixture.php | 8 ++------ .../src/Fixture/StaticPageFixture.php | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php index 5dc49062..937a6267 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/ProjectTimeLineFixture.php @@ -19,10 +19,8 @@ class ProjectTimeLineFixture extends AbstractFixture implements DependentFixture * {@inheritdoc} */ public function load() { - $today = strtotime('today'); $tenDaysLater = strtotime('+10 days', $today); - $node = Node::create([ 'type' => 'project', 'title' => 'project - Projekt Tidslinje', @@ -30,10 +28,8 @@ public function load() { "field_description" => "field_description - Her forklare jeg noget", "field_project_finish" => date('d-m-Y', $tenDaysLater), "field_project_start" => date('d-m-Y', $today), - "field_timeline_items" => [ - 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), - // 'target_revision_id' => $this->getReference(''), - ], + "field_timeline_items" => + ['target_id' => $this->getReference('paragraph:content_list:content_list1')->id()], ]); $this->addReference('project:fixture-1', $node); $node->save(); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php index 17db3a3e..cc2f728c 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -24,7 +24,7 @@ public function load() { 'title' => 'Statisk side 223232323', 'status' => NodeInterface::PUBLISHED, "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()], -// "field_section" => [], Hvad er det + // "field_section" => [], Hvad er det "field_teaser" => 'field teaser', "field_sidebar" => ['value' => 'Sidebar ?'], "field_teaser_color" => '#fff', From 9f0535688dc4bad88f8aefab49f784dacb7a1564 Mon Sep 17 00:00:00 2001 From: Martin Kristainsen Date: Wed, 25 Oct 2023 08:39:06 +0200 Subject: [PATCH 15/15] feature/HRN-756-New-Fixtures removed uncommented files --- .../src/Fixture/PublicMeetingFixture.php | 10 ---------- .../src/Fixture/StaticPageFixture.php | 1 - 2 files changed, 11 deletions(-) diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php index a1118e54..a392aed5 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/PublicMeetingFixture.php @@ -35,31 +35,21 @@ public function load() { "field_hidden_signup" => 4 , "field_last_meeting_time" => date("Y-m-d", 1283166912) , "field_last_meeting_time_end" => date("Y-m-d", 2222222322222), - // "field_map" => 'field_map' , "field_media_document" => ['target_id' => $this->getReference('media_library:Fil:MTM')->id()], "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()] , - // "field_pretix_dates" => 'field_pretix_dates' , "field_pretix_event_settings" => ['template_event' => 'testvej 1', 'synchronize_event' => FALSE], "field_email" => 'parent@test.dk ', "field_project_reference" => 'field_project_reference' , - // "field_public_meeting_cancelled" => - // 'field_public_meeting_cancelled', - // Warning: file_get_contents(themes/custom/hoeringsportal/build/) "field_registration_deadline" => ['value' => 'word'], 'field_section' => [ 'target_id' => $this->getReference('paragraph:content_list:content_list1')->id(), 'target_revision_id' => $this->getReference('paragraph:content_list:content_list1')->getRevisionId(), ], - // "field_signup_link" => $this->getReference('paragraph:link1')->id(), - // // Virker ikke blob ? "field_signup_selection" => 'field_signup_selection' , "field_signup_text" => 'field_signup_text' , "field_teaser" => 'field_teaser' , - // "field_type" => [ - // "taxonomy_index" => - // ["tid" => 1283166912]] // ingen fejl men vises ikke i db ]); $this->addReference('public_meeting:fixture-1', $node); $node->save(); diff --git a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php index cc2f728c..7872a9b7 100644 --- a/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php +++ b/web/modules/custom/hoeringsportal_base_fixtures/src/Fixture/StaticPageFixture.php @@ -24,7 +24,6 @@ public function load() { 'title' => 'Statisk side 223232323', 'status' => NodeInterface::PUBLISHED, "field_media_image_single" => ['target_id' => $this->getReference('media_library:Billede:MTM')->id()], - // "field_section" => [], Hvad er det "field_teaser" => 'field teaser', "field_sidebar" => ['value' => 'Sidebar ?'], "field_teaser_color" => '#fff',