What I read didn't really follow Drupal code standards at all. Coder can help automate the fixes.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | fpc_6_with_tests.patch | 25.24 KB | afreeman |
| #11 | fpc_5_with_tests.patch | 21.2 KB | afreeman |
| #10 | fpc_4_with_tests.patch | 21.2 KB | afreeman |
| #8 | fpc_3_with_tests.patch | 21.44 KB | afreeman |
| #6 | fpc_2_with_tests.patch | 15.53 KB | afreeman |
Comments
Comment #1
afreeman commentedThe attached patch attempts to address the current issues with this module. The code's been reformated to meet standards, the module now uses it's own table instead of modifying core schema, and there are fixes in place for the admin edit issue and user logout issue.
Comment #2
deekayen commentedPatch doesn't apply. It should be a cvs diff specific to the module directory, not relative to the directories on your machine.
Comment #3
afreeman commentedRe-rolled patch with tests.
Comment #4
deekayen commentedPatch is still relative to your local filesystem. Please make a cvs diff. http://drupal.org/patch/create
Comment #5
deekayen commentedTests are also missing in patch.
Comment #6
afreeman commentedTake 2.
Comment #7
deekayen commentedThe code you diffed against is not a cvs checkout judging from the block of stuff in .info for version, core, project, and datestamp. Project module adds those lines when it zips up the project and they shouldn't ever be committed back to cvs.
Patch still doesn't pass normal or minor level tests.
// $Id$to the top of filesWhy is there HTML in the submit handler for the settings form? I don't like how that's handled. I don't imagine that the role gets xss scrubbed on insert, so the literal output there seems like an open security door. Try making that just a comma delimited list and use % for the t() instead of ! perhaps?
preg_replace is overkill in hook_init(). Try strtr or str_replace instead.
Why are you accessing $_GET['q'] instead of arg() to read logout?
Should hook_init really be hook_boot?
I'm having trouble with the select distinct from user; thing on install and then keeping an entire copy of the users table. Why can't hook_user load, and update handle null returns so that you don't have to keep a row for every user? If a row exists, then they need their password updated, else, your password is fine.
In hook_user, case update, why not just clean the uid out of the table if the load can handle a missing value?
"Do Stuff" is a totally worthless description for the tests.
I wasn't able to run the tests. It errored out on me, but that might just be my local config gone bad. I only see a test of the form. It is missing some tests still.
Might as well roll in #705068: Add a checkbox on user edit (and add) form to force password change on next login and create tests for it. I didn't see that in this patch, either.
Comment #8
afreeman commentedTake 3
Comment #9
deekayen commentedI didn't run coder this time, but I don't think
if(variable_get('first_time_login_password_change',0)) {spacing would pass either on the if or args. there are similar cases elsewhereDo Stuff remains, preg_replace remains. Why is the login case commented out in hook_user?
Comment #10
afreeman commentedTake 4
Comment #11
afreeman commentedFah, missed the preg_replace. Fixed.
Comment #12
afreeman commentedComment #13
deekayen commentedComment #14
deekayen commentedComment #15
afreeman commentedThanks for your patience and time. Let's try this again. I've made the changes you mentioned. Additionally I've rewritten the test suite for the module from the ground up to include substantially more robust testing. In response to our conversation about hook_init() vs hook_boot() I ran the current test suite with caching disabled, set to normal, and set to aggressive with none of the tests reporting failure. In light of this I think hook_init() should work fine.
Comment #16
afreeman commentedComment #17
jaypanAs I am the sole maintainer of this project, I code it to my own coding standards. Thank you for your suggestions on coding, but I will only be accepting patches for bug fixes. Thank you.
Comment #18
deekayen commentedWell then I guess we can't play in your fork and we'll just have to move it back to #292166: force password change on next login, where it should have been in the first place.