Skip to content

Commit

Permalink
Allow references to 'path'; test using ezplatform 1.5 instead of 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Sep 29, 2016
1 parent 56dc943 commit 8292d8c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ matrix:
env: EZ_PACKAGES='ezsystems/ezpublish-community:~2014.11.0 ezsystems/behatbundle:~5.4' EZ_VERSION=ezpublish-community EZ_APP_DIR=ezpublish EZ_KERNEL=EzPublishKernel CODE_COVERAGE=1
# latest version currently available of eZPlatform aka eZPublish 6
#- php: 5.6
# env: EZ_PACKAGES='ezsystems/ezplatform:~1.4.0 ezsystems/behatbundle:~6.3' EZ_VERSION=ezplatform EZ_APP_DIR=app EZ_KERNEL=AppKernel CODE_COVERAGE=0
# env: EZ_PACKAGES='ezsystems/ezplatform:~1.5.0 ezsystems/behatbundle:^6.3' EZ_VERSION=ezplatform EZ_APP_DIR=app EZ_KERNEL=AppKernel CODE_COVERAGE=0
- php: 7.0
env: EZ_PACKAGES='ezsystems/ezplatform:~1.4.0 ezsystems/behatbundle:~6.3' EZ_VERSION=ezplatform EZ_APP_DIR=app EZ_KERNEL=AppKernel CODE_COVERAGE=0
env: EZ_PACKAGES='ezsystems/ezplatform:~1.5.0 ezsystems/behatbundle:^6.3' EZ_VERSION=ezplatform EZ_APP_DIR=app EZ_KERNEL=AppKernel CODE_COVERAGE=0

allow_failures:
# this currently fails because of eZPublish services.yml not quoting usage of @, despite it being tested with Sf 2.8...
Expand Down
11 changes: 7 additions & 4 deletions Core/Executor/ContentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,17 @@ protected function setReferences($content)
case 'id':
$value = $content->id;
break;
case 'location_id':
$value = $content->contentInfo->mainLocationId;
break;
case 'remote_id':
case 'content_remote_id':
$value = $content->contentInfo->remoteId;
break;

case 'location_id':
$value = $content->contentInfo->mainLocationId;
break;
case 'path':
$locationService = $this->repository->getLocationService();
$value = $locationService->loadLocation($content->contentInfo->mainLocationId)->pathString;
break;
default:
throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute']);
}
Expand Down
3 changes: 3 additions & 0 deletions Core/Executor/LocationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ protected function setReferences($location)
case 'location_remote_id':
$value = $location->remoteId;
break;
case 'path':
$value = $location->pathString;
break;
default:
throw new \InvalidArgumentException('Location Manager does not support setting references for attribute ' . $reference['attribute']);
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/DSL/ManageContent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
references: #Optional
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # An attribute to get the value of for the reference (supports: content_id and location_id)
attribute: attributeId # An attribute to get the value of for the reference (supports: content_id, content_remote_id, location_id, path)

-
type: content
Expand Down
5 changes: 5 additions & 0 deletions Resources/doc/DSL/ManageLocation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
# - modified_subnode
sort_field: x # Optional
sort_order: ASC|DESC # Optional
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
references: # Optional
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # An attribute to get the value of for the reference (supports: location_id, location_remote_id, path)
-
type: location
mode: create
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/DSL/ManageRolesAndPolicies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#
# Subtree limitation example:
# identifier: Subtree
# value: [/1/2/3/4, /1/2/3/15] # List of subtree path strings, needs to be the location id path
# value: [/1/2/3/4, /1/2/3/15] # List of subtree path strings, needs to be the location path
#
# UserGroup limitation example:
# identifier: UserGroup
Expand Down
3 changes: 3 additions & 0 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Version 2.1.0
=============

* New: it is now possible to set a reference to the path of a created Content/Location.
This allow to use it subsequently when assigning a role with subtree limitation

* Fix: the documentation describing usage of the 'match' keyword for updating/deleting contents and locations was
incorrect

Expand Down

0 comments on commit 8292d8c

Please sign in to comment.