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.

CommentFileSizeAuthor
#12 password_policy-make_password_redirect_overridable-1424324-12.patch2.5 KBerikwebb
PASSED: [[SimpleTest]]: [MySQL] 334 pass(es). View
#10 password_policy-make_password_redirect_overridable-1424324-10.patch2.49 KBerikwebb
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/password_policy/password_policy.install. View
#3 password_tab_url-1424324-3-D6.patch1.65 KBpdrake
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-3-D6.patch. Unable to apply patch. See the log in the details link for more information. View
#2 password_tab_url-1424324-2-D6.patch1.62 KBpdrake
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-2-D6.patch. Unable to apply patch. See the log in the details link for more information. View
#1 password_tab_url-1424324-1-D6.patch791 bytespdrake
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-1-D6.patch. Unable to apply patch. See the log in the details link for more information. View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

pdrake’s picture

FileSize
791 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-1-D6.patch. Unable to apply patch. See the log in the details link for more information. View

Initial implementation.

pdrake’s picture

Status: Active » Needs review
FileSize
1.62 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-2-D6.patch. Unable to apply patch. See the log in the details link for more information. View

This patch includes both the above change and the necessary variable management in password_policy_password_tab.install.

pdrake’s picture

FileSize
1.65 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch password_tab_url-1424324-3-D6.patch. Unable to apply patch. See the log in the details link for more information. View

Attached 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.

erikwebb’s picture

Status: Needs review » Postponed (maintainer needs more info)

What 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?

pdrake’s picture

Status: Postponed (maintainer needs more info) » Needs review

In my use-case, it enables me to utilize this functionality with another module - specifically, chgpwd (see http://drupal.org/node/1424404).

erikwebb’s picture

I 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?

pdrake’s picture

I'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?

erikwebb’s picture

Status: Needs review » Closed (works as designed)

Ah 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 -

Local tasks are menu items that describe different displays of data, and are generally rendered as tabs.

Since your application would require a redirect, this no longer fits into the tab menu model.

pdrake’s picture

Status: Closed (works as designed) » Needs review

The 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.

erikwebb’s picture

Title: Make password change tab support more generic » Make password redirect URL overridable
Status: Needs review » Needs work
FileSize
2.49 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/password_policy/password_policy.install. View

Now 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.

erikwebb’s picture

Status: Needs work » Needs review
erikwebb’s picture

FileSize
2.5 KB
PASSED: [[SimpleTest]]: [MySQL] 334 pass(es). View

Sorry, stupid syntax mistake.

greggles’s picture

Looks sane to me.

erikwebb’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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