Skip to content

Conversation

@vidarl
Copy link
Contributor

@vidarl vidarl commented Oct 24, 2025

🎫 Issue IBX-10854

It is not possible to publish content in hidden state

For QA:

Documentation:

@vidarl vidarl changed the base branch from main to 4.6 October 24, 2025 12:22
Comment on lines 2531 to 2532
// If content is in draft state, mainLocationId is yet not set
if ($contentInfo->mainLocationId !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is true, then a dedicated ContentInfo method should probably be introduced.

Copy link
Contributor Author

@vidarl vidarl Oct 27, 2025

Choose a reason for hiding this comment

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

@Steveb-p
Okay, so I first thought about adding function like this:

+    public function isInitialDraft(): bool
+    {
+        return $this->status === self::STATUS_DRAFT && $this->currentVersionNo === 1;
+    }

However, then I realized that this is not needed for ContentInfo as existing ContentInfo::isDraft() will do just fine. This method will only return true if Content in question has never been published. Once Content is published, ContentInfo::isDraft() will still return false when you create new drafts for that content.

Fixed in acbb2d8

Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

AFAIR this is by-design. There's no purpose to hiding content drafts because content drafts can be read by people with versionread policy, the same as hidden content can be accessed. Are you trying to fix some fatal error or enable hiding drafts? TL;DR;.

@vidarl
Copy link
Contributor Author

vidarl commented Oct 27, 2025

There's no purpose to hiding content drafts because

yes, it is. If you don't want content to be visible at time of publishing.

Are you trying to fix some fatal error or enable hiding drafts?

@alongosz
I am trying to publish content as hidden. The use-case is:
Write a new article but translate it to multiple languages before making it visible. Since admin-ui cannot edit multiple languages for the same version, publish it as hidden would do the trick

edited....

@sonarqubecloud
Copy link

@vidarl vidarl requested review from Steveb-p and alongosz October 29, 2025 07:32
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.

5 participants