TheSourceUK / tridion-2011-power-tools

Automatically exported from code.google.com/p/tridion-2011-power-tools
0 stars 0 forks source link

AddUser Powertool Is Broken (I Fixed It) #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the code for the AddUserCommand.js, the following line:

PowerTools.Model.Services.AddUser.CreateUser(userName, onSuccess, 
this.getErrorHandler());

in the AddUserCommand function causes an error because there is no 
"getErrorHandler()" method in scope.

While I do not know the original intent of that function call, I presume that 
what was meant was to make use of the "_handleFailure" handler function.

Changing the AddUserCommand to read as follows resolves the issue and the tool 
works as expected:

var userName = prompt("Please enter a username e.g. 'DOMAIN\\USER'", "");
var onSuccess = this.getDelegate(this._handleSuccess);
var onFailure = this.getDelegate(this._handleFailure);
$messages.registerProgress("Adding user...", userName, false);
PowerTools.Model.Services.AddUser.CreateUser(userName, onSuccess, onFailure);

Original issue reported on code.google.com by n.vander...@building-blocks.com on 24 Jun 2014 at 6:26

GoogleCodeExporter commented 8 years ago
It appears this issue is not isolated to 2013. I installed the AddUser tools to 
2011 SP1 HR2 over the weekend and faced the same problem!

Thanks for the fix Nicholas.

Original comment by c.mor...@building-blocks.com on 30 Jun 2014 at 2:20

GoogleCodeExporter commented 8 years ago
I wasn't notified of this, but indeed the code seems wrong and your fix is how 
I would do it too. So I'll incorporate the fix as soon as possible.

Original comment by pkjaer....@gmail.com on 3 Jul 2014 at 11:07

GoogleCodeExporter commented 8 years ago
I have finally incorporated the fix into the trunk. The next installer will 
have the fix (in addition to the fix for an XML validation error in 
Editor.config!)

Thanks for reporting it and even providing the code to fix it ;)

Original comment by pkjaer....@gmail.com on 22 Jul 2014 at 1:01