The field permissions appeared be not there when we do a plain migration from the D7 to D8 using field permissions.

Comments

heshanlk created an issue. See original summary.

hypertext200’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB
jhedstrom’s picture

Thanks for working on this! Just a few small changes/fixes here I think:

  1. +++ b/src/Plugin/migrate/process/FieldPermissioSettings.php
    @@ -0,0 +1,35 @@
    +class FieldPermissioSettings extends ProcessPluginBase {
    

    Both the file name and the class name are missing an 'n' in FieldPermissioSettings.

  2. +++ b/src/Plugin/migrate/process/FieldPermissioSettings.php
    @@ -0,0 +1,35 @@
    +    switch($value['type']){
    +      case 0:
    +      $permission_type = 'public';
    +      break;
    +      case 1:
    +      $permission_type = 'private';
    +      break;
    +      case 2:
    +      $permission_type = 'custom';
    +      break;
    +    }
    

    Coding standards nit here. There should be spaces in the switch bit, and indentation under each case.

    Also, can you use the class constants here for the values (such as FieldPermissionTypeInterface::ACCESS_CUSTOM)?

hypertext200’s picture

StatusFileSize
new1.28 KB

Thanks @jhedstrom for pointing me out those issues. I fixed those and recreated the patch and attached here.

  • jhedstrom committed a2ce3f8 on 8.x-1.x authored by heshanlk
    Issue #2839545 by heshanlk: Process plugin to migrate field permissions...
jhedstrom’s picture

Status: Needs review » Fixed

Thanks! Committed to 8.x!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.