Opening a new issue from discussion.

The rules component for group fails to validate with an error message
Integrity check for the imported configuration failed. Error message: Data selector <em class="placeholder">group-membership:roles</em> for parameter <em class="placeholder">list</em> is invalid..

The error appears with 7.x-1.0 beta 6 as well as latest dev (beta6+8dev).

Can you please help?

Comments

shas3n created an issue. See original summary.

shas3n’s picture

Issue summary: View changes
kristiaanvandeneynde’s picture

This has probably nothing do with Group, but with the way your rules are set up. Either:

  • group-membership is undefined and thus group-membership:roles is too
  • group-membership is defined but not a GroupMembership entity and thus it has no roles property

In #2603136: Rules integration I provided you with an export. Did you import it as is or fiddle with it first? If you imported it without changing anything, it should work seeing as how it gives me no errors here.

shas3n’s picture

Assigned: Unassigned » shas3n
Status: Active » Closed (fixed)

I did try to include the component manually based on your code. So, I get the component that exports as below. The change seems to be the group-memberships:0:roles which I guess is the result of different types of groups/memberships/fields I have?

Tomorrow I will try to see if this works within the rules to do what I want to do and report back. I will mark this issue as closed now.

{ "rules_add_role_to_group_members" : {
    "LABEL" : "Add role to group members",
    "PLUGIN" : "action set",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "USES VARIABLES" : {
      "group" : { "label" : "Group", "type" : "group" },
      "group_role" : { "label" : "Group role", "type" : "group_role" }
    },
    "ACTION SET" : [
      { "entity_query" : {
          "USING" : {
            "type" : "group_membership",
            "property" : "group",
            "value" : [ "group" ],
            "limit" : "1000"
          },
          "PROVIDE" : { "entity_fetched" : { "group_memberships" : "Group Memberships" } }
        }
      },
      { "LOOP" : {
          "USING" : { "list" : [ "group-memberships" ] },
          "ITEM" : { "group_membership" : "Group membership" },
          "DO" : [
            { "list_add" : {
                "list" : [ "group-memberships:0:roles" ],
                "item" : [ "group-role" ],
                "unique" : "1"
              }
            },
            { "entity_save" : { "data" : [ "group-membership" ], "immediate" : "1" } }
          ]
        }
      }
    ]
  }
}