Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Remove import site from site creation module and fix delete sites (9.0) #5440

Open
wants to merge 11 commits into
base: 9.0
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jan 16, 2025

Resolves: #4719

In #5139 i removed the capabilities to create composer packages via web request which is now obsolete as we have the new CLI / Web setup: #4243

Now we can also reimplement 'import site' based on new SiteImportService from #5307 - the thing is this comes with some limitations like in use with CLI:

  • as proposed here Discussion improve site entity and site node relation #4470 (comment) the site must have a field to define the contentRepositoryId. In the current state we can only know via the to be created site name plus the site configuration in Neos.Neos.sites via its name or the fallback * which is the 'destined' content repository.

  • a current limitation of the setup is that it can really only be executed once. After the events are set deleting the site (soft, without pruning the cr) a reimport would just duplicate the events again which is not the desired step probably. For that we allow to prune the site via flow cr:pruneAll. Those steps are to be used with care and not available via GUI.

The advantage CLI gives us is that for example failures in the done replay and all other steps are not obscured and can easily be be debugged. Also for managing multiple content repositories or changing dimensions configuration changes have to be undertaken which is closer to CLI.

Further we found out that the limitation of running the import only once makes it unusable with no site setup because the backend doesnt really work and we can get rid of the import functionality: #4719 (comment)


Bugfix: Use withoutAuthorizationChecks to remove site via user interface

The CR security was introduced with #5298

And now fails when fetching the content graph or deleting nodes:

Read access denied for workspace "user-editor": User is a Neos Administrator without explicit role for workspace "user-editor"

The herby proposed fix is not perfect but so is the whole site deletion, instead only the base workspace should need to be deleted and the others need to be rebased.

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

…ehand

This bases on the thesis that the created site's name will use the configuration "*" which by default uses the default preset.
because a site deletion does not prune the content repository we cannot reimport the nodes
The CR security was introduced with

neos#5298

And now fails when fetching the content graph or deleting nodes:

> Read access denied for workspace "user-editor": User is a Neos Administrator without explicit role for workspace "user-editor"

The herby proposed fix is not perfect but so is the whole site deletion, instead only the base workspace should need to be deleted and the others need to be rebased.
@mhsdesign mhsdesign changed the title BUGFIX: Finalise and deprecate site creation module for Neos 9.0 BUGFIX: Remove import site from site creation module and fix delete sites (9.0) Jan 20, 2025
<legend>{neos:backend.translate(id: 'sites.createBlank', value: 'Create a blank site', source: 'Modules')}</legend>
In the content repository: "{defaultContentRepositoryForNewSites}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a translation key here, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore Sites Management module
2 participants