Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to make support for the password change tab more generic through the user of a variable so that modules such as chgpwd may be used with password_policy.
Comments
Comment #1
pdrake CreditAttribution: pdrake commentedInitial implementation.
Comment #2
pdrake CreditAttribution: pdrake commentedThis patch includes both the above change and the necessary variable management in password_policy_password_tab.install.
Comment #3
pdrake CreditAttribution: pdrake commentedAttached is a patch that will apply cleanly to 6.x-1.0-beta1 for anyone who may be running that version. Otherwise, this patch may be ignored.
Comment #4
erikwebb CreditAttribution: erikwebb commentedWhat is the exact use case here? I understand making the URL more generic, but how does this make interoperability any easier than just a form alter?
Comment #5
pdrake CreditAttribution: pdrake commentedIn my use-case, it enables me to utilize this functionality with another module - specifically, chgpwd (see http://drupal.org/node/1424404).
Comment #6
erikwebb CreditAttribution: erikwebb commentedI don't mean what module needs the integration. What is the point in making this more generic when someone could already use a form alter to modify whatever they need to?
Comment #7
pdrake CreditAttribution: pdrake commentedI'm afraid I don't understand. In this case, the redirect occurs in hook_init and redirects the user (via drupal_goto) to a particular URL when a password change is forced. I'm not sure how a hook_form_alter could cause this to behave differently, except maybe to perform yet another drupal_goto in the hook_form_alter?
Comment #8
erikwebb CreditAttribution: erikwebb commentedAh I see. I don't think creating a redirect from a tab is good UX. I would suggest hiding the tab and creating a link within the normal user form. From the hook_menu() documentation -
Since your application would require a redirect, this no longer fits into the tab menu model.
Comment #9
pdrake CreditAttribution: pdrake commentedThe existing code redirects the user to a fixed URL which is supported by 1 module. It does this in hook_init if a password change is forced. The change I'm proposing is to redirect to a variable URL which is supported by 2 modules. It will still do this at hook_init if a password change is forced. This does not have anything to do with tabs or menu entries.
Comment #10
erikwebb CreditAttribution: erikwebb commentedNow I fully understand. You're not really making the change tab more generic. This is actually an issue to make the password redirect overridable. My apologies for being a bit stubborn.
I think your patch is a bit too assumptive. I've changed the install functions to be more adaptive if another module has taken over this behavior. Also I've properly namespaced the variable.
Comment #11
erikwebb CreditAttribution: erikwebb commentedComment #12
erikwebb CreditAttribution: erikwebb commentedSorry, stupid syntax mistake.
Comment #13
gregglesLooks sane to me.
Comment #14
erikwebb CreditAttribution: erikwebb commentedFixed and committed.
http://drupalcode.org/project/password_policy.git/commit/0e0fb93