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

Create new contents on demand #2049

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 22, 2021

What is this pull request for?

If new contents have been defined on the elements definition, but they are not existing yet we create them on demand.

This happens during rendering (speak loading) elements in the elements window during page edit. Ideally we would only instantiate them, but since the content editors expect a persisted content we cannot do that.

Thanks @mamhoff for that smart idea.

This also closes #2031

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

tvdeyen added 2 commits March 22, 2021 13:13
Instead of in the view
If new contents have been defined on the elements definition, but they are
not existing yet we create them on demand.

This happens during rendering (speak loading) elements in the elements window
during page edit. Ideally we would only instantiate them, but since the content
editors expect a persisted content we cannot do that.

This also closes AlchemyCMS#2031
@tvdeyen tvdeyen requested a review from mamhoff March 22, 2021 12:29
@tvdeyen tvdeyen changed the title Build new contents automatically Create new contents on demand Mar 22, 2021
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

YESSS

@tvdeyen tvdeyen added this to the 6.0 milestone Mar 22, 2021
@tvdeyen tvdeyen merged commit 94190bb into AlchemyCMS:main Mar 22, 2021
@tvdeyen tvdeyen deleted the build-new-contents-automatically branch March 22, 2021 12:58
@dbwinger
Copy link
Contributor

This is very helpful. Thanks! Any plans to back-port this to 5.1 & 5.2? If it's not already planned, mind if I cook up a PR for that?

@tvdeyen
Copy link
Member Author

tvdeyen commented Mar 22, 2021

This is very helpful. Thanks! Any plans to back-port this to 5.1 & 5.2? If it's not already planned, mind if I cook up a PR for that?

Not planned yet. But happy to ship this with 5.1 and 5.2 if you open PR(s).

rickythefox added a commit to rickythefox/alchemy_cms that referenced this pull request Apr 7, 2021
@rickythefox rickythefox mentioned this pull request Apr 7, 2021
3 tasks
@rickythefox rickythefox mentioned this pull request May 5, 2021
3 tasks
tvdeyen added a commit that referenced this pull request May 5, 2021
tvdeyen added a commit that referenced this pull request May 5, 2021
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.

Order ui for Essences by declaration
3 participants