I did some cleanup to make use of some of D6's features. We can call drupal_get_form() directly from the menu system and ditch some of the _page functions. Also by using the %menu loaders we can get rid of arg() calls and make the forms more re-usable. I split apply_for_role_manage_form() in to apply_for_role_approve_form() and apply_for_role_remove_form() it's pretty close in terms of line count and now each is much more focused on what it does.

I also did some work on apply_for_role_apply_form() to cut down the number of SQL queries run. Now it just runs one query to load all their role applications then does some array foo to limit it down to the desired rows.

There's also a bug fix rolled in here, the apply_for_role_multiple variable was being loaded with a default value of array() which wouldn't pass the $multiple == 1 test.

CommentFileSizeAuthor
#1 afr_cleanup.patch10.29 KBdrewish
afr_cleanup.patch9.59 KBdrewish

Comments

drewish’s picture

StatusFileSize
new10.29 KB

found another bug with the variable_get('apply_for_role_register', array()) it'll never evaluate to true.

Soren Jones’s picture

Andrew,

Very, very cool.

Best,
Soren

Soren Jones’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.