Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
4.6.7
-
None
-
Yes
Description
Changing the isAlwaysAvailable flag in the ContentType setting doesn't change existing anything for existing content of the ContentType:
In admin this feature is available when editing the content type:
If you want the code to have any effect on existing content, you need to update all content of that ContentType:
private function setAlwaysAvailable(Content $valueObject, bool $isAlwaysAvailable) { // check if there is anything to do if ($valueObject->contentInfo->alwaysAvailable === $isAlwaysAvailable) { return true; }; $contentMetadataUpdateStruct = $this->contentService->newContentMetadataUpdateStruct(); $contentMetadataUpdateStruct->alwaysAvailable = $isAlwaysAvailable; $update = $this->contentService->updateContentMetadata( $valueObject->contentInfo, $contentMetadataUpdateStruct ); return $isAlwaysAvailable === $update->contentInfo->alwaysAvailable; }
Todo:
- The admin-ui should inform the user that changing the value have no effect on existing content ( It doesn't even work to re-publish existing content)
- It should be possible to update existing content when changing this setting (commandline tool for instance)
- This should be documented