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

Update Location fails if no change is performed with the update

    XMLWordPrintable

Details

    • Pollux Core S3

    Description

      If you use the api to update a Location and pass a LocationStruct which values are identicals to the Location ones, update process will throw an exception saying your location is not found anymore

      Steps to reproduce:

      You can try this cli command from one of your bundles (apply your namespace and bundle name accordingly )

      class TestCommand extends ContainerAwareCommand
      {
          protected function configure()
          {
              $this->setName( 'namespace:bundle:test' )->setDefinition(array());
          }
      
          protected function execute( InputInterface $input, OutputInterface $output )
          {
              $repository = $this->getContainer()->get( 'ezpublish.api.repository' );
              $locationService = $repository->getLocationService();
              $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) );
      
              $rootLocation = $locationService->loadLocation( 2 );
              $locationUpdateStruct = $locationService->newLocationUpdateStruct();
              $locationUpdateStruct->priority = 100;
              // first will be ok
              $output->writeln( 'First attempt should be ok...');
              $locationService->updateLocation( $rootLocation, $locationUpdateStruct );
      
              $output->writeln( 'Second attempt will fail...' );
              $locationService->updateLocation( $rootLocation, $locationUpdateStruct );
          }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            desorden desorden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 1 day, 3 hours, 10 minutes Remaining Estimate - 1 hour, 30 minutes
                1h 30m
                Logged:
                Time Spent - 1 day, 3 hours, 10 minutes Remaining Estimate - 1 hour, 30 minutes
                1d 3h 10m