Bug #49423

Role name and packageKey are not accessible

Added by Rafael Kähm over 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-06-25
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

Properties name and packageKey for Role are not accessible, because setNameAndPackageKey() is not called.

Calling setNameAndPackageKey() in __construct() solves this.

#1

Updated by Alexander Berl over 7 years ago

setNameAndPackageKey() is called within initializeObject, so it should be called with __construct() automatically via the proxy class. How did you instanciate the Role object? Could this possibly be related to #47975?

#2

Updated by Rafael Kähm over 7 years ago

Alexander Berl,

yes it is but _construct() is not called by roles from repository.
_construct() is called only by "Anonymous" and "Everybody".

Q: How did you instanciate the Role object?
A: Roles are loaded from Repository over Account. ($account->getRoles())

#3

Updated by Jacob Rasmussen about 7 years ago

I've noticed the same - and it doesn't matter if the roles are loaded directly from the repository using $repository->findAll() or as Rafael did - $account->getRoles()

Also available in: Atom PDF