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

Changes 8: New ModelWithContent::version method #6455

Merged
merged 17 commits into from
Jun 18, 2024

Conversation

bastianallgeier
Copy link
Member

@bastianallgeier bastianallgeier commented May 21, 2024

This PR …

Features

  • New ModelWithContent::version() method

Refactoring

  • Use new version method wherever it makes sense.
    • ModelWithContent::convertTo
    • ModelWithContent::readContent
    • ModelWithContent::writeContent
    • File::modifiedContent
    • Page::modified
    • System::exposedFileUrl
    • User::exists
    • User::modified
    • ContentTranslation::contentFile
    • FileActionsTest
    • PageActionsTest

The other methods are hard to test for the abstract class. We should probably add tests for the PlainTextContentStorageHandler class but so far all those tests have been missing anyway.

Breaking changes

  • ModelWithContent::version() is now a reserved keyword. If you've used a field with this name, you need to use $model->content()->get('version') instead to work with the field.
  • Page::modified(), File::modifiedContent() and User::modified() now use the current language instead of the default language.

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@bastianallgeier bastianallgeier added this to the 5.0.0-alpha.1 milestone May 21, 2024
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from 9a3fd8e to 0f9107a Compare May 22, 2024 12:38
@bastianallgeier bastianallgeier changed the base branch from v5/develop to v5/changes/move-content-storage-methods May 22, 2024 12:38
@bastianallgeier bastianallgeier force-pushed the v5/changes/move-content-storage-methods branch from 238b762 to 006e269 Compare June 5, 2024 10:11
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from 0f9107a to 1e395cb Compare June 5, 2024 10:15
@bastianallgeier bastianallgeier force-pushed the v5/changes/move-content-storage-methods branch from 006e269 to e21848a Compare June 11, 2024 10:11
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from ab78bed to 2cfcabc Compare June 11, 2024 10:15
@bastianallgeier bastianallgeier force-pushed the v5/changes/move-content-storage-methods branch from e21848a to df52ad8 Compare June 11, 2024 14:15
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from 2cfcabc to 25994e3 Compare June 11, 2024 14:15
@bastianallgeier bastianallgeier force-pushed the v5/changes/move-content-storage-methods branch from df52ad8 to d949cff Compare June 13, 2024 07:56
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from 25994e3 to 814f8c7 Compare June 13, 2024 09:16
Base automatically changed from v5/changes/move-content-storage-methods to v5/develop June 16, 2024 18:40
@lukasbestle lukasbestle marked this pull request as ready for review June 16, 2024 19:04
src/Cms/Page.php Show resolved Hide resolved
src/Cms/User.php Show resolved Hide resolved
tests/Cms/Models/ModelWithContentTest.php Outdated Show resolved Hide resolved
@bastianallgeier bastianallgeier force-pushed the v5/changes/model-version branch from 814f8c7 to 0626fea Compare June 17, 2024 09:01
@lukasbestle lukasbestle merged commit f4073eb into v5/develop Jun 18, 2024
10 checks passed
@lukasbestle lukasbestle deleted the v5/changes/model-version branch June 18, 2024 19:51
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.

3 participants