Skip to content

Commit

Permalink
[Tree] The value of path source property is cast to string type for M…
Browse files Browse the repository at this point in the history
…aterialized Path Tree strategy

Cherry picked from 2.4.x branch. #2061
  • Loading branch information
kosarinin authored and AkenRoberts committed Jan 18, 2020
1 parent 3a3af13 commit f65e418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ a release.
#### Fixed
- Removed `null` parameter from `Doctrine\Common\Cache\Cache::save()` calls (#1996)

### Tree
#### Fixed
- The value of path source property is cast to string type for Materialized Path Tree strategy (#2061)

## [2.4.38] - 2019-11-08
### Global / Shared
#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Tree/Strategy/AbstractMaterializedPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function updateNode(ObjectManager $om, $node, AdapterInterface $ea)
$pathProp->setAccessible(true);
$pathSourceProp = $meta->getReflectionProperty($config['path_source']);
$pathSourceProp->setAccessible(true);
$path = $pathSourceProp->getValue($node);
$path = (string) $pathSourceProp->getValue($node);

// We need to avoid the presence of the path separator in the path source
if (strpos($path, $config['path_separator']) !== false) {
Expand Down

0 comments on commit f65e418

Please sign in to comment.