From c0ea2c071e0f828c87b3abddd7d6a7e56ba82dba Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 24 May 2024 13:20:05 +0200 Subject: [PATCH 01/11] BUGFIX: Reset projections after setup in `cr:setup` command Fixes: #5008 --- .../Classes/Command/CrCommandController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index b5d98b29e8e..7696dbbd19a 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -44,6 +44,9 @@ public function setupCommand(string $contentRepository = 'default', bool $resetP { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); + $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); + $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); + if ($resetProjections) { if (!$this->output->askConfirmation(sprintf('> Advanced Mode. The flag --reset-projections will reset all projections in "%s", which leaves you with empty projections to be replayed. Are you sure to proceed? (y/n) ', $contentRepositoryId->value), false)) { $this->outputLine('Abort.'); @@ -54,9 +57,6 @@ public function setupCommand(string $contentRepository = 'default', bool $resetP $projectionService->resetAllProjections(); $this->outputLine('All projections of Content Repository "%s" were resettet.', [$contentRepositoryId->value]); } - - $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); - $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); } /** From 5a092d0536b6420e1a5f5af0bbe5a18e1f1b25df Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 25 May 2024 14:12:08 +0200 Subject: [PATCH 02/11] Remove `--reset-projections` flag --- .../Classes/Command/CrCommandController.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index 7696dbbd19a..47ab58afc2a 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -38,25 +38,13 @@ public function __construct( * That command will also display information what is about to be migrated. * * @param string $contentRepository Identifier of the Content Repository to set up - * @param bool $resetProjections Advanced. Can be used in rare cases when the projections cannot be migrated to reset everything in advance. This requires a full replay afterwards. */ - public function setupCommand(string $contentRepository = 'default', bool $resetProjections = false): void + public function setupCommand(string $contentRepository = 'default'): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); - - if ($resetProjections) { - if (!$this->output->askConfirmation(sprintf('> Advanced Mode. The flag --reset-projections will reset all projections in "%s", which leaves you with empty projections to be replayed. Are you sure to proceed? (y/n) ', $contentRepositoryId->value), false)) { - $this->outputLine('Abort.'); - return; - } - - $projectionService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->projectionServiceFactory); - $projectionService->resetAllProjections(); - $this->outputLine('All projections of Content Repository "%s" were resettet.', [$contentRepositoryId->value]); - } } /** From 4cbe2a40361c43db46c371cb66116fccfe52849b Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 27 May 2024 09:59:19 +0200 Subject: [PATCH 03/11] TASK: Use correct @template-covariant tag for ProjectionFactoryInterface See also https://github.com/neos/neos-development-collection/commit/329330e02b6b3aec50c1c3e041306f67ce59809d See https://phpstan.org/blog/whats-up-with-template-covariant --- .../Classes/Projection/ProjectionFactoryInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.ContentRepository.Core/Classes/Projection/ProjectionFactoryInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ProjectionFactoryInterface.php index e1609e6e6be..6c0de0992d5 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ProjectionFactoryInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ProjectionFactoryInterface.php @@ -7,7 +7,7 @@ use Neos\ContentRepository\Core\Factory\ProjectionFactoryDependencies; /** - * @template T of ProjectionInterface + * @template-covariant T of ProjectionInterface * @api */ interface ProjectionFactoryInterface From 82d54ce9a8f98fffbe4e7988acd654e7234a4b8c Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Tue, 11 Jun 2024 17:40:17 +0200 Subject: [PATCH 04/11] TASK: Tweak README This converts the `Readme.rst` to Markdown and splits it into two separate files, `README.md` and `CONTRIBUTING.md` as is convention these days. --- CONTRIBUTING.md | 134 +++++++++++++++++++++++++++++++ README.md | 93 ++++++++++++++++++++++ Readme.rst | 208 ------------------------------------------------ 3 files changed, 227 insertions(+), 208 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 README.md delete mode 100644 Readme.rst diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..0ff168555fc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,134 @@ +# Contributing + +**For (specific) Notes on Neos 9, see further down…** + +If you want to contribute to Neos and want to set up a development environment, then follow these steps: + +```shell +composer create-project neos/neos-development-distribution neos-development 8.3.x-dev --keep-vcs +``` + +Note the **-distribution** repository you create a project from, instead of just checking out this repository. + +If you need a different branch, you can either use it from the start (replace the ``8.3.x-dev`` by ``9.0.x-dev`` or whatever you need), or switch after checkout (just make sure to run composer update afterwards to get matching dependencies installed.) In a nutshell, to switch the branch you intend to work on, run: + +```shell +git checkout 9.0 && composer update +``` + +The code of the CMS can then be found inside `Packages/Neos`, which itself is the neos-development-collection Git repository. You commit changes and create pull requests from this repository. + +- To commit changes to Neos switch into the `Neos` directory (`cd Packages/Neos`) and do all Git-related work (`git add .`, `git commit`, etc) there. +- If you want to contribute to the Neos UI, please take a look at the explanations at https://github.com/neos/neos-ui#contributing on how to work with that. +- If you want to contribute to the Flow Framework, you find that inside the `Packages/Framework` folder. See https://github.com/neos/flow-development-collection + +In the root directory of the development distribution, you can do the following things: + +To run tests, run `./bin/phpunit -c ./Build/BuildEssentials/PhpUnit/UnitTests.xml` for unit tests or `./bin/phpunit -c ./Build/BuildEssentials/PhpUnit/FunctionalTests.xml` for functional/integration tests. + +--- + +**Note** + +We use an upmerging strategy: create all bugfixes to the lowest maintained branch that contains the issue. Typically, this is the second last LTS release - see the diagram at https://www.neos.io/features/release-process.html. + + For new features, pull requests should be made against the branch for the next minor version (named like `x.y`). Breaking changes must only go into the branch for the next major version. + +--- + +For more detailed information, see https://discuss.neos.io/t/development-setup/504, +https://discuss.neos.io/t/creating-a-pull-request/506 and +https://discuss.neos.io/t/git-branch-handling-in-the-neos-project/6013 + + +## Neos 9 + + +### Prerequisites + +- You need PHP 8.2 installed. +- Please be sure to run off the Neos development distribution in branch 9.0, to avoid dependency issues. + +### Setup + +The Event-Sourced Content Repository has a Docker Compose file included in `Neos.ContentRepository.BehavioralTests` which starts both Mariadb and Postgres in compatible versions. Additionally, there exists a helper to change the configuration in your distribution (`/Configuration`) to the correct values matching this database. + +Do the following for setting up everything: + +1. Start the databases: + + ```shell + pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose up -d; popd + + # to stop the databases: + pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose down; popd + # to stop the databases AND remove the stored data: + pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose down -v; popd + ``` + +2. Copy matching Configuration: + + ```shell + cp -R Packages/Neos/Neos.ContentRepository.BehavioralTests/DistributionConfigurationTemplate/* Configuration/ + ``` + +3. Run Doctrine Migrations: + + ```shell + ./flow doctrine:migrate + FLOW_CONTEXT=Testing/Postgres ./flow doctrine:migrate + ``` + +4. Setup the Content Repository + + ```shell + ./flow cr:setup + ``` + +5. Set up Behat + + ```shell + cp -R Packages/Neos/Neos.ContentRepository.BehavioralTests/DistributionBehatTemplate/ Build/Behat + pushd Build/Behat/ + rm composer.lock + composer install + popd + ``` + +### Running the Tests + +The normal mode is running PHP locally, but running Mariadb / Postgres in containers (so we know +we use the right versions etc). + +```shell +bin/behat -c Packages/Neos/Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist +``` + +Running all tests can take a long time, depending on the hardware. +To speed up the process, Behat tests can be executed in a "synchronous" mode by setting the `CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION` environment variable: + +```shell +CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION=1 bin/behat -c Packages/Neos/Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist +``` + +Alternatively, if you want to reproduce errors as they happen inside the CI system, but you +develop on Mac OS, you might want to run the Behat tests in a Docker container (= a linux environment) +as well. We have seen cases where they behave differently, i.e. where they run without race +conditions on OSX, but with race conditions in Linux/Docker. Additionally, the Linux/Docker setup +described below also makes it easy to run the race-condition-detector: + +```shell +docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml build +docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml up -d +docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml run neos /bin/bash + +# the following commands now run INSIDE the Neos docker container: +FLOW_CONTEXT=Testing/Behat ../../../../../flow raceConditionTracker:reset + +../../../../../bin/behat -c behat.yml.dist + +# To run tests in speed mode, run CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION=1 +CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION=1 ../../../../../bin/behat -c behat.yml.dist + +FLOW_CONTEXT=Testing/Behat ../../../../../flow raceConditionTracker:analyzeTrace +``` diff --git a/README.md b/README.md new file mode 100644 index 00000000000..b7cb5af08a2 --- /dev/null +++ b/README.md @@ -0,0 +1,93 @@ +[![Code +Climate](https://codeclimate.com/github/neos/neos-development-collection/badges/gpa.svg)](https://codeclimate.com/github/neos/neos-development-collection) +[![StyleCI](https://styleci.io/repos/40964014/shield?style=flat)](https://styleci.io/repos/40964014) +[![Latest Stable +Version](https://poser.pugx.org/neos/neos-development-collection/v/9.0)](https://packagist.org/packages/neos/neos-development-collection) +[![License](https://poser.pugx.org/neos/neos-development-collection/license)](https://raw.githubusercontent.com/neos/neos-development-collection/9.0/LICENSE) +[![Documentation](https://img.shields.io/badge/documentation-master-blue.svg)](https://neos.readthedocs.org/en/9.0/) +[![Slack](http://slack.neos.io/badge.svg)](http://slack.neos.io) +[![Discussion Forum](https://img.shields.io/badge/forum-Discourse-39c6ff.svg)](https://discuss.neos.io/) +[![Issues](https://img.shields.io/github/issues/neos/neos-development-collection.svg)](https://github.com/neos/neos-development-collection/issues) +[![Translation](https://img.shields.io/badge/translate-weblate-85ae52.svg)](https://hosted.weblate.org/projects/neos/) +[![Twitter](https://img.shields.io/twitter/follow/neoscms.svg?style=social)](https://twitter.com/NeosCMS) + +# Neos development collection + +This repository is a collection of packages for the Neos content +application platform (learn more on ). The +repository is used for development and all pull requests should go into +it. + +## Installation and Setup + +If you want to install Neos, please have a look at the installation & +setup documentation: + + +**For (specific) documentation on Neos 9, read on below...** + +## Contributing + +If you want to contribute to Neos and want to set up a development +environment, then please read the instructions in [CONTRIBUTING.md](CONTRIBUTING.md) + +**For (specific) documentation on Neos 9, read on below...** + +## Neos 9 and the Event-Sourced Content Repository (ES CR) + +### Prerequisites + +- You need PHP 8.2 installed. +- Please be sure to run off the Neos development distribution in branch 9.0, to avoid dependency issues. + +### Setup + +Follow the usual configuration steps (as for Neos 8) to install Composer dependencies and configure the database connection in `Settings.yaml` Then: + +1. Run Doctrine Migrations: + + ``` bash + ./flow doctrine:migrate + FLOW_CONTEXT=Testing/Postgres ./flow doctrine:migrate + ``` + +2. Setup the Content Repository + + ``` bash + ./flow cr:setup + ``` + +### Site Setup + +You can chose from one of the following options: + +#### Creating a new Site + +``` bash +./flow site:create neosdemo Neos.Demo Neos.Demo:Document.Homepage +``` + +#### Migrating an existing (Neos < 9.0) Site + +``` bash +# WORKAROUND: for now, you still need to create a site (which must match the root node name) +# !! in the future, you would want to import *INTO* a given site (and replace its root node) +./flow site:create neosdemo Neos.Demo Neos.Demo:Document.Homepage + +# the following config points to a Neos 8.0 database (adjust to your needs), created by +# the legacy "./flow site:import Neos.Demo" command. +./flow cr:migrateLegacyData --config '{"dbal": {"dbname": "neos80"}, "resourcesPath": "/path/to/neos-8.0/Data/Persistent/Resources"}' +``` + +#### Importing an existing (Neos >= 9.0) Site from an Export + +``` bash +# import the event stream from the Neos.Demo package +./flow cr:import Packages/Sites/Neos.Demo/Resources/Private/Content +``` + +### Running Neos + +> ``` bash +> ./flow server:run +> ``` diff --git a/Readme.rst b/Readme.rst deleted file mode 100644 index 4f54dd91f31..00000000000 --- a/Readme.rst +++ /dev/null @@ -1,208 +0,0 @@ -|Code Climate| |StyleCI| |Latest Stable Version| |License| |Docs| |Slack| |Forum| |Issues| |Translate| |Twitter| - -.. |Code Climate| image:: https://codeclimate.com/github/neos/neos-development-collection/badges/gpa.svg - :target: https://codeclimate.com/github/neos/neos-development-collection -.. |StyleCI| image:: https://styleci.io/repos/40964014/shield?style=flat - :target: https://styleci.io/repos/40964014 -.. |Latest Stable Version| image:: https://poser.pugx.org/neos/neos-development-collection/v/9.0 - :target: https://packagist.org/packages/neos/neos-development-collection -.. |License| image:: https://poser.pugx.org/neos/neos-development-collection/license - :target: https://raw.githubusercontent.com/neos/neos-development-collection/9.0/LICENSE -.. |Docs| image:: https://img.shields.io/badge/documentation-master-blue.svg - :target: https://neos.readthedocs.org/en/9.0/ - :alt: Documentation -.. |Slack| image:: http://slack.neos.io/badge.svg - :target: http://slack.neos.io - :alt: Slack -.. |Forum| image:: https://img.shields.io/badge/forum-Discourse-39c6ff.svg - :target: https://discuss.neos.io/ - :alt: Discussion Forum -.. |Issues| image:: https://img.shields.io/github/issues/neos/neos-development-collection.svg - :target: https://github.com/neos/neos-development-collection/issues - :alt: Issues -.. |Translate| image:: https://img.shields.io/badge/translate-weblate-85ae52.svg - :target: https://hosted.weblate.org/projects/neos/ - :alt: Translation -.. |Twitter| image:: https://img.shields.io/twitter/follow/neoscms.svg?style=social - :target: https://twitter.com/NeosCMS - :alt: Twitter - ---------------------------- -Neos development collection ---------------------------- - -**FOR DOCS ON THE EVENT SOURCED CONTENT REPOSITORY, READ ON BELOW** - -This repository is a collection of packages for the Neos content application platform (learn more on https://www.neos.io/). -The repository is used for development and all pull requests should go into it. - -If you want to install Neos, please have a look at the documentation: https://neos.readthedocs.org/en/latest/ - -Contributing -============ - -If you want to contribute to Neos and want to set up a development environment, then follow these steps: - -``composer create-project neos/neos-development-distribution neos-development 8.3.x-dev --keep-vcs`` - -Note the **-distribution** repository you create a project from, instead of just checking out this repository. - -If you need a different branch, you can either use it from the start (replace the ``8.3.x-dev`` by ``9.0.x-dev`` or whatever you need), or switch after checkout (just make sure to run composer update afterwards to get matching dependencies installed.) In a nutshell, to switch the branch you intend to work on, run: - -``git checkout 9.0 && composer update`` - -The code of the CMS can then be found inside ``Packages/Neos``, which itself is the neos-development-collection Git repository. You commit changes and create pull requests from this repository. - -- To commit changes to Neos switch into the ``Neos`` directory (``cd Packages/Neos``) and do all Git-related work (``git add .``, ``git commit``, etc) there. -- If you want to contribute to the Neos UI, please take a look at the explanations at https://github.com/neos/neos-ui#contributing on how to work with that. -- If you want to contribute to the Flow Framework, you find that inside the ``Packages/Framework`` folder. See https://github.com/neos/flow-development-collection - -In the root directory of the development distribution, you can do the following things: - -To run tests, run ``./bin/phpunit -c ./Build/BuildEssentials/PhpUnit/UnitTests.xml`` for unit tests or ``./bin/phpunit -c ./Build/BuildEssentials/PhpUnit/FunctionalTests.xml`` for functional/integration tests. - -.. note:: We use an upmerging strategy: create all bugfixes to the lowest maintained branch that contains the issue. Typically, this is the second last LTS release - see the diagram at https://www.neos.io/features/release-process.html. - - For new features, pull requests should be made against the branch for the next minor version (named like ``x.y``). Breaking changes must only go into the branch for the next major version. - -For more detailed information, see https://discuss.neos.io/t/development-setup/504, -https://discuss.neos.io/t/creating-a-pull-request/506 and -https://discuss.neos.io/t/git-branch-handling-in-the-neos-project/6013 - - ----------------------------------------------- -New (Event Sourced) Content Repository (ES CR) ----------------------------------------------- - -Prerequisites -============= - -- You need PHP 8.2 installed. -- You need a recent MySQL/MariaDB (PostgreSQL ist not yet supported) -- Please be sure to run off the Neos-Development-Distribution in Branch 9.0, to avoid dependency issues (as described above). - -Setup -===== - -The ES CR has a Docker-compose file included in `Neos.ContentRepository.BehavioralTests` which starts both -Mariadb and Postgres in compatible versions. Additionally, there exists a helper to change the configuration -in your distribution (`/Configuration`) to the correct values matching this database. - -Do the following for setting up everything: - -1. Start the databases: - - .. code-block:: bash - - pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose up -d; popd - - # to stop the databases: - pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose down; popd - # to stop the databases AND remove the stored data: - pushd Packages/Neos/Neos.ContentRepository.BehavioralTests; docker compose down -v; popd - -2. Copy matching Configuration: - - .. code-block:: bash - - cp -R Packages/Neos/Neos.ContentRepository.BehavioralTests/DistributionConfigurationTemplate/* Configuration/ - -3. Run Doctrine Migrations: - - .. code-block:: bash - - ./flow doctrine:migrate - FLOW_CONTEXT=Testing/Postgres ./flow doctrine:migrate - -4. Setup the Content Repository - - .. code-block:: bash - - ./flow cr:setup - -5. Set up Behat - - .. code-block:: bash - - cp -R Packages/Neos/Neos.ContentRepository.BehavioralTests/DistributionConfigurationTemplate/ Build/Behat - pushd Build/Behat/ - rm composer.lock - composer install - popd - -Site Setup -========== - -You can chose from one of the following options: - -Creating a new Site -------------------- - -.. code-block:: bash - - ./flow site:create neosdemo Neos.Demo Neos.Demo:Document.Homepage - - -Migrating an existing (Neos < 9.0) Site ---------------------------------------- - -.. code-block:: bash - - # WORKAROUND: for now, you still need to create a site (which must match the root node name) - # !! in the future, you would want to import *INTO* a given site (and replace its root node) - ./flow site:create neosdemo Neos.Demo Neos.Demo:Document.Homepage - - # the following config points to a Neos 8.0 database (adjust to your needs), created by - # the legacy "./flow site:import Neos.Demo" command. - ./flow cr:migrateLegacyData --config '{"dbal": {"dbname": "neos80"}, "resourcesPath": "/path/to/neos-8.0/Data/Persistent/Resources"}' - - # TODO: this JSON config is hard to write - we should change this soonish. - - - -Importing an existing (Neos >= 9.0) Site from an Export -------------------------------------------------------- - -.. code-block:: bash - - # import the event stream from the Neos.Demo package - ./flow cr:import Packages/Sites/Neos.Demo/Resources/Private/Content - - -Running Neos -============ - - .. code-block:: bash - - ./flow server:run - - -Running the Tests -================= - -The normal mode is running PHP locally, but running Mariadb / Postgres in containers (so we know -we use the right versions etc). - - .. code-block:: bash - - cd Packages/Neos - composer test:behavioral - -Alternatively, if you want to reproduce errors as they happen inside the CI system, but you -develop on Mac OS, you might want to run the Behat tests in a Docker container (= a linux environment) -as well. We have seen cases where they behave differently, i.e. where they run without race -conditions on OSX, but with race conditions in Linux/Docker. Additionally, the Linux/Docker setup -described below also makes it easy to run the race-condition-detector: - - .. code-block:: bash - - docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml build - docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml up -d - docker compose --project-directory . --file Packages/Neos/Neos.ContentRepository.BehavioralTests/docker-compose-full.yml run neos /bin/bash - - # the following commands now run INSIDE the Neos docker container: - FLOW_CONTEXT=Testing/Behat ../../../../../flow raceConditionTracker:reset - - ../../../../../bin/behat -c behat.yml.dist - - FLOW_CONTEXT=Testing/Behat ../../../../../flow raceConditionTracker:analyzeTrace From 8340466b0ab7fe77f5f2c36b3136b69953e1eb7f Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:49:38 +0200 Subject: [PATCH 05/11] TASK: Remove `createSitePackage` action Triggering the creation of a composer package via `Neos.SiteKickstarter` from the web will be removed See discussion regarding fragile GUI setups and the preferred use of cli instead: https://github.com/neos/neos-development-collection/issues/4243 --- .../Module/Administration/SitesController.php | 86 +------------------ .../Module/Administration/Sites/NewSite.html | 34 -------- .../Private/Translations/en/Modules.xlf | 27 ------ 3 files changed, 3 insertions(+), 144 deletions(-) diff --git a/Neos.Neos/Classes/Controller/Module/Administration/SitesController.php b/Neos.Neos/Classes/Controller/Module/Administration/SitesController.php index 7ee46bbe473..1c047fc9b4d 100755 --- a/Neos.Neos/Classes/Controller/Module/Administration/SitesController.php +++ b/Neos.Neos/Classes/Controller/Module/Administration/SitesController.php @@ -233,13 +233,9 @@ public function updateSiteAction(Site $site, $newSiteNodeName) } /** - * Create a new site form. - * - * @param Site $site Site to create - * @Flow\IgnoreValidation("$site") - * @return void + * Create a new site form */ - public function newSiteAction(Site $site = null) + public function newSiteAction(): void { // This is not 100% correct, but it is as good as we can get it to work right now try { @@ -259,88 +255,12 @@ public function newSiteAction(Site $site = null) $sitePackages = $this->packageManager->getFilteredPackages('available', 'neos-site'); - $generatorServiceIsAvailable = $this->packageManager->isPackageAvailable('Neos.SiteKickstarter'); - $generatorServices = []; - - if ($generatorServiceIsAvailable) { - /** @var SiteGeneratorCollectingService $siteGeneratorCollectingService */ - $siteGeneratorCollectingService = $this->objectManager->get(SiteGeneratorCollectingService::class); - /** @var SitePackageGeneratorNameService $sitePackageGeneratorNameService */ - $sitePackageGeneratorNameService = $this->objectManager->get(SitePackageGeneratorNameService::class); - - $generatorClasses = $siteGeneratorCollectingService->getAllGenerators(); - - foreach ($generatorClasses as $generatorClass) { - $name = $sitePackageGeneratorNameService->getNameOfSitePackageGenerator($generatorClass); - $generatorServices[$generatorClass] = $name; - } - } - $this->view->assignMultiple([ 'sitePackages' => $sitePackages, - 'documentNodeTypes' => $documentNodeTypes, - 'site' => $site, - 'generatorServiceIsAvailable' => $generatorServiceIsAvailable, - 'generatorServices' => $generatorServices + 'documentNodeTypes' => $documentNodeTypes ]); } - /** - * Create a new site-package and directly import it. - * - * @param string $packageKey Package Name to create - * @param string $generatorClass Generator Class to generate the site package - * @param string $siteName Site Name to create - * @Flow\Validate(argumentName="$packageKey", type="\Neos\Neos\Validation\Validator\PackageKeyValidator") - * @return void - */ - public function createSitePackageAction(string $packageKey, string $generatorClass, string $siteName): void - { - if ($this->packageManager->isPackageAvailable('Neos.SiteKickstarter') === false) { - $this->addFlashMessage( - $this->getModuleLabel('sites.missingPackage.body', ['Neos.SiteKickstarter']), - $this->getModuleLabel('sites.missingPackage.title'), - Message::SEVERITY_ERROR, - [], - 1475736232 - ); - $this->redirect('index'); - } - - if ($this->packageManager->isPackageAvailable($packageKey)) { - $this->addFlashMessage( - $this->getModuleLabel('sites.invalidPackageKey.body', [htmlspecialchars($packageKey)]), - $this->getModuleLabel('sites.invalidPackageKey.title'), - Message::SEVERITY_ERROR, - [], - 1412372021 - ); - $this->redirect('index'); - } - // this should never happen, but if somebody posts unexpected data to the form, - // it should stop here and return some readable error message - if ($this->objectManager->has($generatorClass) === false) { - $this->addFlashMessage( - 'The generator class "%s" is not present.', - 'Missing generator class', - Message::SEVERITY_ERROR, - [$generatorClass] - ); - $this->redirect('index'); - } - - /** @var SitePackageGeneratorInterface $generatorService */ - $generatorService = $this->objectManager->get($generatorClass); - $generatorService->generateSitePackage($packageKey, $siteName); - - $this->controllerContext->getFlashMessageContainer()->addMessage(new Message(sprintf( - $this->getModuleLabel('sites.sitePackagesWasCreated.body', [htmlspecialchars($packageKey)]), - '', - null - ))); - $this->forward('importSite', null, null, ['packageKey' => $packageKey]); - } - /** * Import a site from site package. * diff --git a/Neos.Neos/Resources/Private/Templates/Module/Administration/Sites/NewSite.html b/Neos.Neos/Resources/Private/Templates/Module/Administration/Sites/NewSite.html index 27d33f25da9..fc2a4a830c0 100644 --- a/Neos.Neos/Resources/Private/Templates/Module/Administration/Sites/NewSite.html +++ b/Neos.Neos/Resources/Private/Templates/Module/Administration/Sites/NewSite.html @@ -59,40 +59,6 @@

{neos:backend.translate(id: 'sites.new', value: 'New site', source: 'Modules - - -
- {neos:backend.translate(id: 'sites.createPackage', value: 'Create a new site-package', source: 'Modules')} - - -
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
- -
- -

{neos:backend.translate(id: 'sites.noNeosKickstarterInfo', value: 'The Neos Kickstarter package is not installed, install it to kickstart new sites.', source: 'Modules') -> f:format.raw()}

-
-
-
-