-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-30681: Fixed double slash in path_identification_string after moveSubtree #2671
Conversation
Please note, existing install might require to run SQL to replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately tests are failing there, so while this fixes some issue in some specific place/for some specific use case, it breaks other parts of the system.
If clean data is incorrect, it should also be a part of the fix.
We cannot accept it in the current form.
@alongosz, please have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path_identification_string
is deprecated and will be dropped in the future, so I would recommend to stop relying on it in favor of Location::$pathString
property.
Issues to resolve:
- This bug exists in
6.7
so the fix need to be targeted to that branch. - The issue for me still exists despite the fix.
- Test case is still missing. Property is not available on API level, so the test is a bit ugly.
Please add it toeZ/Publish/API/Repository/Tests/LocationServiceTest.php
. Please Note that the test case was done on7.5
branch, so doing it on6.7
might require some changes.
/**
* Test that Legacy ezcontentobject_tree.path_identification_string field is correctly updated
* after moving subtree.
*
* @covers \eZ\Publish\API\Repository\LocationService::moveSubtree
*
* @throws \ErrorException
* @throws \eZ\Publish\API\Repository\Exceptions\ForbiddenException
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
*/
public function testMoveSubtreeUpdatesPathIdentificationString()
{
$repository = $this->getRepository();
$locationService = $repository->getLocationService();
$topNode = $this->createFolder(['eng-US' => 'top_node'], 2);
$newParentLocation = $locationService->loadLocation(
$this
->createFolder(['eng-US' => 'Parent'], $topNode->contentInfo->mainLocationId)
->contentInfo
->mainLocationId
);
$location = $locationService->loadLocation(
$this
->createFolder(['eng-US' => 'Move Me'], $topNode->contentInfo->mainLocationId)
->contentInfo
->mainLocationId
);
$locationService->moveSubtree($location, $newParentLocation);
// path location string is not present on API level, so we need to query database
$connection = $this->getRawDatabaseConnection();
$query = $connection->createQueryBuilder();
$query
->select('path_identification_string')
->from('ezcontentobject_tree')
->where('node_id = :nodeId')
->setParameter('nodeId', $location->id);
self::assertEquals(
'top_node/parent/move_me',
$query->execute()->fetchColumn()
);
}
4b6b058
to
b5a9e28
Compare
Please review. |
45f2cd8
to
0ee113c
Compare
@SerheyDolgushev in the future please fetch latest upstream changes before doing rebase. You've rebased against 6.7 from September 2018, which gave our QA a headache 😜 This time I fixed that for you and force-pushed :) // cc @barbaragr |
You can merge it up |
Done |
@alongosz should a new item be added to PR todo list? Something like "Check that you are using the latest source branch"? |
Maybe, but I wonder if this would be understood out of context. Moreover some people (not gonna point fingers ;p) tend to check boxes regardless of if they did the thing, so I started to find this pointless :P |
master
Use case:
ezcontentobject_tree.path_identification_string
for moved node.Expected result:
node_2/parent/move_me
Actual result:
node_2/parent//move_me
TODO:
$ composer fix-cs
).