Closed (fixed)
Project:
Masquerade
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2009 at 04:23 UTC
Updated:
13 Nov 2009 at 23:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
callison commentedOops. Accidentally renamed a function. Updated patch.
Comment #2
deviantintegral commentedThanks for the patch. It looks like the patch needs to be re-rolled against the latest -dev release. For the most part, the method looks good. Comments follow:
The indentation needs to be fixed here.
This line needs to end with a period. As well, parameters and return values need to be documented.
The indentation needs to be fixed in this function - see http://drupal.org/coding-standards
Why do we return true here?
Would it make more sense to do a user_load on uid=0?
Fix indentation.
Fix comment style.
Not sure why there is a change here.
I'm on crack. Are you, too?
Comment #3
callison commentedThanks for your comments, deviantintegral.
Sorry for all the indentation issues - I used an editor with auto-indentation. Should be fixed now.
The one that returns true does so because in masquerade_admin_settings_validate it will set a form error if the function returns false. This didn't seem like a very intuitive way to go about this, but it works. I'll put a comment there to try and avoid confusion.
Comment #4
callison commentedCouple of things changed from my previous post:
Firstly, I had made an error with the autocomplete. This patch is correct and autocomplete works great.
Secondly, I completely removed the function _masquerade_test_user() because it is virtually useless with the masquerade_user_load() function. To mimic the functionality, you simply call _masquerade_user_load(variable_get('masquerade_test_user', '')) so it was being unnecessarily repetitive.
Comment #5
callison commentedSorry to keep doing this. I need to test these better before posting them. This patch fixes a small problem in the last one.
Comment #6
deviantintegral commentedFor some reason I had to manually apply the changes in masquerade_menu(). Also, on applying the patch, I got:
I've fixed both of these errors as well as fixing a similar issue in masquerade_block_0(). As well, I've modified _masquerade_user_load() to return FALSE, just like user_load(). When wrapping a core function, it's best to keep the return values as similar as possible. Let me know how it works / reviews for you.
Comment #7
callison commentedWorks great for me! Thanks for your fixes.
Comment #8
callison commentedUpdated status.
Comment #9
deviantintegral commentedFYI, the proper status would be Reviewed and Tested by the Community. "to be ported" is if the patch was to be backported to a previous Drupal version.
I've committed this patch.