[MAGNOLIA-1256] MgnlGroupManager, MgnlRoleManager, MgnlUserManager fail to create groups, roles, and users respectively via their associated create... methods. Created: 06/Dec/06  Updated: 23/Jan/13  Resolved: 07/Dec/06

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 3.0 Final
Fix Version/s: 3.0.1

Type: Bug Priority: Major
Reporter: Chris Miner Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File patch.txt     Text File stacktrace.txt    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

the group and role managers try to create content rather than groups or roles. All the classes call the save method on the newly created node, which fails due to the apparent fact that it isn't allowed to call save on a newly created node. See attached patch and stack.



 Comments   
Comment by Magnolia International [ 07/Dec/06 ]

Chris, is it on purpose that you use getHierarchyManager().save() instead of node.save() ? I don't see a reason for this.
I'll apply your 3 patches as soon as this gets answered

Comment by Capitaine Harold [ 07/Dec/06 ]

Hi Gregory,

I haven't worked on these patchs, but I often work with hierarchymanager.
So if you create a content for a defined path, you have to call hierarchymanager.save() if you want to really save it on the workspace.
I suppose if you do node.save(), it saves everything that have been done under this node.

What I say is maybe wrong, but it's the only way for me to save a new node in a workspace.

Hope to be helpful.

Regards.

Comment by Magnolia International [ 07/Dec/06 ]

haa, true. Thanks !

Comment by Magnolia International [ 07/Dec/06 ]

Patch applied, thanks !

Comment by Chris Miner [ 07/Dec/06 ]

The other option is to call save on the new nodes parent. Which in the case of users, groups, and roles is the root node, which means all the nodes in the workspace. At which point I thought both approaches were basically the same and went with the one that would leave the least doubt as to what would happen.

Comment by Magnolia International [ 07/Dec/06 ]

perfect - thanks again

Generated at Mon Feb 12 03:25:10 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.