Details
-
Bug
-
Resolution: Fixed
-
High
-
5.2, 5.3, 5.4.0
-
None
-
Castor Core S6, Castor Core S7
Description
We must document that using the same environment is critical when persistence cache is involved. If two executions, using the same repository, don't use the same cache storage, inconsistencies may lead to exceptions from the SPI, as described below.
When an content object is moved to a new location, and the original parent is removed, attempting to generate it's alias/route will result in an exception.
The problem only occurs in prod environment, which indicates a SPI cache issue.
Steps to reproduce
- Create folder "A "
- Create content object "Test" under folder "A"
- Run the test command with --env=prod
- Move "Test" content to root location "Home".
- Remove folder "A"
- Run the test command once more in prod.
Test Command:
protected function configure() { $this->setName( 'test:urlalias' ) ->addArgument( 'locationId', InputArgument::REQUIRED, 'location Id.' ); } /** * @param InputInterface $input Predefined parameter for commands * @param OutputInterface $output Predefined parameter for commands */ protected function execute( InputInterface $input, OutputInterface $output ) { $repository = $this->getContainer()->get( 'ezpublish.api.repository' ); // login admin user $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) ); $locationId = $input->getArgument( 'locationId' ); $router = $this->getContainer()->get( 'router' ); print_r( $router->generate( 'ez_urlalias', array( 'locationId' => $locationId ) ) ); }