Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-8475

Notify user that changing isAlwaysAvailable flag in content type doesn't change existing content

    XMLWordPrintable

Details

    • 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:

      1.  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)
      2.  It should be possible to update existing content when changing this setting (commandline tool for instance)
      3. This should be documented

      Designs

        Attachments

          Activity

            People

              vidar.langseid@ibexa.co Vidar Langseid
              vidar.langseid@ibexa.co Vidar Langseid
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: