Pennebaker / craftcms-thearchitect

CraftCMS plugin to generate content models from JSON data.
MIT License
171 stars 9 forks source link

Running an export in migrations with devMode on produces a warning #36

Closed jberglund closed 7 years ago

jberglund commented 7 years ago

in_array() expects parameter 2 to be array, null given at https://github.com/Pennebaker/craftcms-thearchitect/blob/master/thearchitect/services/TheArchitectService.php#L2006

Edit: in_array("accesscp", null)this is where it fails. When exporting manually it happends when the admin user + any other user is selected. If all other users/usergroups are selected the export runs just fine.

spAnser commented 7 years ago

Having trouble reproducing this. Can you post the exported JSON of all the users/usergroups.

Feel free to replace the emails and/or names usernames in the export with dummy content.

jberglund commented 7 years ago

I'm able to reproduce this with another Craft installation with the following steps:

Having no permissions assigned to the group, devmode or not, works without problems.

With devmode off I'm able to export: { "users": [ { "enabled": 1, "archived": 0, "locale": "no", "localeEnabled": true, "username": "admin", "email": "XXX", "weekStartDay": 1, "admin": 1, "client": 0, "locked": 0, "suspended": 0, "pending": 0 }, { "enabled": 1, "archived": 0, "locale": "no", "localeEnabled": true, "username": "test", "firstName": "test", "lastName": "test", "email": "XXX, "weekStartDay": 1, "admin": 0, "client": 0, "locked": 0, "suspended": 0, "pending": 1, "groups": [ "test" ], "permissions": { "general": [ "accessCp", "registerUsers", "assignUserPermissions", "changeUserEmails", "administrateUsers", "editUsers", "deleteUsers" ] } } ], "userGroups": [ { "name": "Test", "handle": "test" } ], "userGroupPermissions": [ { "handle": "test", "permissions": [] } ] }

spAnser commented 7 years ago

Figured it out I didn't add any permissions to my test user groups.

Looking into why this is happening now.

spAnser commented 7 years ago

Released 1.6.0-beta.2 It should fix the issue.