Skip to content

IBX-11780: Integrated ContentPublicationStrategyInterface into ContentFormProcessor publish flow - #113

Open
bnowak wants to merge 3 commits into
6.0from
IBX-11780-integrated-content-publication-strategy-into-ContentFormProcessor
Open

IBX-11780: Integrated ContentPublicationStrategyInterface into ContentFormProcessor publish flow#113
bnowak wants to merge 3 commits into
6.0from
IBX-11780-integrated-content-publication-strategy-into-ContentFormProcessor

Conversation

@bnowak

@bnowak bnowak commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-11780

Related PRs:

Description:

ContentFormProcessor::processPublish() now publishes through ContentPublicationStrategyInterface (ibexa/core) instead of calling ContentService::publishVersion() directly. The strategy chain resolves to the synchronous strategy by default, or to the asynchronous one (ibexa/async-content-publishing) when asynchronous content publishing is enabled.

The strategy returns a ContentPublicationResult whose publishedContent is null on the asynchronous path, therefore:

  • the content event payload was replaced with content_type (derived from the draft) — payload consumers are adjusted in the ibexa/dashboard and ibexa/admin-ui counterpart PRs,
  • on the asynchronous path the redirect targets are derived from the draft; for never-published content no location exists yet, so the redirect is made to the content tree root

The synchronous path behaves exactly as before. processPublish() is now covered with unit tests (strategy invocation, payload contract, sync/async redirect matrix, redirectUrlAfterPublish override).

For QA:

  • With asynchronous content publishing disabled (default): publishing existing and newly created content from AdminUI behaves as before (redirect to the content/location view).
  • With asynchronous content publishing enabled: the publish action returns immediately; publishing an existing item redirects to its location view and the new version goes live once the background job completes.

Documentation:

Part of the IBX-11780 asynchronous content publishing epic — editor-facing behaviour (non-blocking publish) is documented at the epic level; nothing separate to document for this PR.

…tFormProcessor publish flow, replaced content payload with content_type and covered processPublish with unit tests
@bnowak
bnowak marked this pull request as ready for review July 20, 2026 09:43
@bnowak
bnowak requested a review from a team July 20, 2026 09:44
Comment thread tests/lib/Form/Processor/ContentFormProcessorTest.php Outdated
Comment on lines +174 to +177
$locationId = $referrerLocation !== null && $data instanceof ContentUpdateData
? $referrerLocation->id
: (int) $this->configResolver->getParameter('content.tree_root.location_id');
$contentId = $this->locationService->loadLocation($locationId)->getContentId();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it has been agreed with Product Team

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only thing changed for user. In async publication mode, when user is creating a new content and clicks publish right away - we don't have any content location to redirect to yet.

It was agreed with @konradoboza and @kmadejski, but unfortunately I don't see any other alternative here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there is at least one place where we store from where user came in and we redirect him to that afterwards. Not sure if this would apply here or if its even worth the effort if we agreed on that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, there's option to pass $referrerLocation to event from place where it's triggered. However, it's not always available (the fact if it's given/passed to event or not, is also based on some logic/use-case). If I'd rely on that, I'd need to have information there if we're publishing in sync or async mode (which currently is not available outside of this processor).
With the general rule that we cannot change how sync mode works, I adjusted only async path here as a consequence. Although I also think it could be done more simply, considering some wider refactor.

Comment thread tests/lib/Form/Processor/ContentFormProcessorTest.php Outdated
Comment thread tests/lib/Form/Processor/ContentFormProcessorTest.php Outdated
…tion expectations in ContentFormProcessor test
@sonarqubecloud

Copy link
Copy Markdown

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.

6 participants