kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

RoleManager::createLimitation fails when using array reference #202

Closed jdegrange closed 5 years ago

jdegrange commented 5 years ago

When setting a custom reference, referencing an array symfony parameter, I want to use this reference as values for a limitation when creating a new Role. But this fail because the array is being encapsulated in an other array. This array :

array(2) {
   [0] =>
   string(6) "value1"
   [1] =>
   string(6) "value2"
 }

give this :

array(1) {
 [0] =>
 array(2) {
   [0] =>
   string(6) "value1"
   [1] =>
   string(6) "value2"
 }
}

Here is a migration sample to reproduce the problem :

-
  type: reference
  mode: set
  identifier: front_siteaccess
  value: '%ezpublish.siteaccess.groups.instance_front_group%'  # => has to be an array
-
  type: reference
  mode: dump
  identifier: reference:front_siteaccess 
-
  type: role
  mode: create
  name: AnonymeTest
  policies:
  -
    module: user
    function: login
    limitations:
      - { identifier: SiteAccess, values: "reference:front_siteaccess" }  # => using my array here fail

Thank you

gggeek commented 5 years ago

Fixed in 5.9.4