Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26255

Cacheable (Http) list of versions in endpoint ezpublish_rest_loadContentVersions

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: High High
    • None
    • None
    • Platform > REST API v2
    • None
    • Prod

    Description

      During development in Studio ( steps exactly as in task https://jira.ez.no/browse/EZS-793 ), on clear database we create draft from existing content "Why we love NYC" and after "Confirm" we don't see all versions of content. We should see 2 versions (Publish and Draft), but we see only Publish version.
      It is causes because after click on Confirm, are running 3 endpoints :

      1) Request URL:http://ezstudio.dev.local/api/ezp/v2/content/objects/68
      Request Method:GET
      In this method is cacheable in Http and in persistance.

      2) ttp://ezstudio.dev.local/api/ezp/v2/content/objects/68/currentversion
      Request Method:POST
      In this method is not cacheable.

      3) http://ezstudio.dev.local/api/ezp/v2/content/objects/68/versions
      Request Method:GET
      In this method is not cacheable in persistance, but controller return list from http cache

      In file eZ/Publish/Core/REST/Server/Controller/Content.php we modified method loadContentVersions and it helps :

          public function loadContentVersions($contentId, Request $request)
          {
              $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);
      
              return new Values\VersionList(
                  $this->repository->getContentService()->loadVersions($contentInfo),
                  $request->getPathInfo()
              );
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            adrian.bartkowiak-obsolete@ez.no Adrian Bartkowiak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: