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

Refactor site creation #3981

Merged
merged 15 commits into from
Oct 8, 2024
Merged

Refactor site creation #3981

merged 15 commits into from
Oct 8, 2024

Conversation

mauritsvanrees
Copy link
Member

This is part of #3961

This affects the site creation process when plone.distribution is not available. See the individual commits for details. In this case, the plone-overview page on the Zope root looks like this:

Screenshot 2024-06-19 at 20 38 50

The Advanced version of the Add Plone Site form is gone. For advanced options you should use a Plone Distribution.

This needs a change in plone.app.testing, otherwise loads of tests fail. Only a one line change though. I will link the PR.

I will keep this as Draft PR for now.

If you need more options, you should add a Plone Distribution to your packages.
The main ones are `plone.volto` and `plone.classicui`.
We now only create a basic Plone site without default example content.
This was already disabled in 2018.
Instead, probably since the same time, we show the plone-overview page on the Zope site root, by using our AppTraverser.
…le_id` keyword arguments.

Show a deprecation warning when these are used.

We never setup content anymore.  Use a Plone Distribution if you need this.
Or pass an extra profile id in the `extension_ids` keyword argument.

Our fallback Add Plone Site form (shown if `plone.distribution` is not available),
now passes the following extension ids:

1. the `factory._TYPES_PROFILE`: `plone.app.contenttypes:default`
2. `plone.app.caching:default` if the package is available.
3. `plonetheme.barceloneta:default`
Currently, lots of tests fail.  To fix that, we need to add the contenttypes profile
in `plone.app.testing.layers.PloneFixture`:

```
    # Extension profiles to be installed with site setup
    extensionProfiles = (
        "plone.app.contenttypes:default",
        "plonetheme.barceloneta:default",
    )
```

Or we change our factory to have those two as default extension_ids, and remove that part from the plone-addsite view.
@mauritsvanrees mauritsvanrees requested a review from ericof June 19, 2024 20:09
@mister-roboto

This comment was marked as resolved.

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Polish up the messages.

Products/CMFPlone/browser/templates/plone-overview.pt Outdated Show resolved Hide resolved
news/3961.breaking.3 Outdated Show resolved Hide resolved
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good so far.

@davisagli davisagli marked this pull request as ready for review September 6, 2024 20:21
mauritsvanrees and others added 2 commits September 12, 2024 12:46
We then pass all other arguments and keyword arguments to the `plone.distribution` site api.
One of the `test_factory.py` tests now uses a new layer using the new `PRODUCTS_CMFPLONE_DISTRIBUTIONS_FIXTURE`.
This is the only layer that defines a dummy distribution in `tests/configure-distributions.zcml`.

Somehow, with the `plone.distribution` zcml loaded, a few tests throw an error when visiting `@@search`:

`zExceptions.NotFound: plone.restapi.controlpanels.registry.SearchControlpanel object at 0x116ea02f0`
@stevepiercy
Copy link
Contributor

Upon merge and release, we need to update the documentation. See plone/documentation#1721

@mauritsvanrees mauritsvanrees merged commit 0e91d5a into master Oct 8, 2024
2 of 4 checks passed
@mauritsvanrees mauritsvanrees deleted the distributions branch October 8, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants