Skip to content

Conversation

Prokyonn
Copy link
Member

@Prokyonn Prokyonn commented Jul 18, 2025

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related issues/PRs #7672
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Adds Versioning to content-bundle entities

  • pages
  • articles
  • snippets

Why?

To Do

  • Create a documentation PR
  • Add breaking changes to UPGRADE.md

@@ -51,7 +51,7 @@ public function removeLegacyPageAdmin(ContainerBuilder $container): void
$definition = $methodCall[1][0];
if ($definition instanceof Definition) {
$class = $definition->getClass();
if ('%sulu_page.admin.class%' === $class) {
if ('Sulu\Bundle\PageBundle\Admin\PageAdmin' === $class) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was overseen when removing the class parameters

Copy link
Member

Choose a reason for hiding this comment

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

use PageAdmin::class

@Prokyonn Prokyonn force-pushed the feature/versioning branch from e95e4e5 to 76aa519 Compare July 22, 2025 12:35
@Prokyonn Prokyonn marked this pull request as ready for review July 22, 2025 12:36
@Prokyonn Prokyonn force-pushed the feature/versioning branch 2 times, most recently from 04b4816 to 77b63f9 Compare July 22, 2025 12:42
@alexander-schranz
Copy link
Member

as discussed I would backport the JS changes to 2.6 branch :)

@Prokyonn
Copy link
Member Author

as discussed I would backport the JS changes to 2.6 branch :)

see #8060 I'll revert it in this branch as soon as the other MR is merged into the 3.0 branch :)

@Prokyonn Prokyonn force-pushed the feature/versioning branch from 1470f4c to 1e10e69 Compare July 23, 2025 07:20
@@ -21,6 +21,8 @@ interface DimensionContentInterface
public const STAGE_DRAFT = 'draft';
public const STAGE_LIVE = 'live';

public const DEFAULT_VERSION = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public const DEFAULT_VERSION = 0;
public const CURRENT_VERSION = 0;

@@ -40,6 +40,8 @@ trait DimensionContentTrait
*/
private $isMerged = false;

private int $version = DimensionContentInterface::DEFAULT_VERSION;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private int $version = DimensionContentInterface::DEFAULT_VERSION;
private int $version = DimensionContentInterface::CURRENT_VERSION;

public static function getDefaultDimensionAttributes(): array
{
return [
'locale' => null,
'stage' => DimensionContentInterface::STAGE_DRAFT,
'version' => DimensionContentInterface::DEFAULT_VERSION,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'version' => DimensionContentInterface::DEFAULT_VERSION,
'version' => DimensionContentInterface::CURRENT_VERSION,

SecurityCheckerInterface $securityChecker,
array $settingsForms
private ViewBuilderFactoryInterface $viewBuilderFactory,
private ActivityViewBuilderFactoryInterface $activityViewBuilderFactory,
Copy link
Member

@alexander-schranz alexander-schranz Jul 25, 2025

Choose a reason for hiding this comment

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

didn't we say its responsoble of page, article and snippet admin to add activity to the insights? and content bundle doesnt know about the activities?

Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

the example bundle seems to miss some changes like the list update.

https://github.com/sulu/sulu/blob/3.0/packages/content/tests/Application/ExampleTestBundle/Resources/config/lists/examples.xml

also think functional test in the ExampleControllerTest is missing?

@Prokyonn Prokyonn force-pushed the feature/versioning branch from 1e10e69 to e462520 Compare July 28, 2025 19:05
Prokyonn added 10 commits July 28, 2025 21:05
# Conflicts:
#	packages/content/src/Infrastructure/Doctrine/DimensionContentQueryEnhancer.php

# Conflicts:
#	packages/page/src/Domain/Model/PageDimensionContent.php
#	packages/page/src/Domain/Model/PageDimensionContentInterface.php
# Conflicts:
#	packages/article/src/Domain/Model/ArticleDimensionContentInterface.php
#	src/Sulu/Bundle/AdminBundle/Resources/js/containers/List/fieldTransformers/DateTimeFieldTransformer.js
@Prokyonn Prokyonn force-pushed the feature/versioning branch from e462520 to bcfd5a8 Compare July 28, 2025 19:05
@alexander-schranz alexander-schranz merged commit 254bb60 into sulu:3.0 Jul 29, 2025
9 checks passed
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.

2 participants