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.
If a form is delivered to a user then she must already be on HTTPS if she has one of the HTTPS secured roles (forced redirect in hook_init()). So it does not make sense to check that again in hook_form_alter(). Patch attached.
This also solves an incompatibility with the overlay module for me, as the overlay javascript considers a form action beginning with "https" to be an external URL. So it changes the form target to "_new" which opens a new window on form submission, which is really confusing.
Comment | File | Size | Author |
---|---|---|---|
#9 | securepages-form-role-1402608-9.patch | 882 bytes | klausi |
#8 | securepages-form-role-1402608-8.patch | 1.05 KB | klausi |
#5 | 1402608-securepages-form-role.patch | 812 bytes | klausi |
securepages-remove-role-check.patch | 776 bytes | klausi |
Comments
Comment #1
grendzy CreditAttribution: grendzy commentedInstead, I added a check for $is_https so the action isn't changed unless needed.
Commit fcfbf84 on master
Comment #2
grendzy CreditAttribution: grendzy commentedThanks. The overlay thing was driving me nuts too.
Commit 5098b1f on 6.x-2.x
Comment #3
klausiBut why don't you just remove the role check all together as I suggested? This is useless code in hook_form_alter(), no?
Comment #4
grendzy CreditAttribution: grendzy commentedYes, now I understand what you mean. This is indeed dead code.
Comment #5
klausiRerolled.
Comment #6
David4514 CreditAttribution: David4514 commentedI too was having issues with overlays. I had included 'admin/people' as one of the pages to be secured.
With the 7.x-1.x branch of securepages (as of 04/20/12), the overlay was hanging when I clicked on the People tab. Until I browsed to a url without an overlay, it remains in a hung state.
I switched to the "master" branch of securepages and applied the patch in #5 (the patch does not apply to the 7.1-1.x branch ???).
Now, when I click on the "People" tab, it opens up, but with the overlay disabled. Is that the intended result? It is better than a hang, but not what I was expecting. I was expecting the People tab to act like the other administrative tabs, but forcing https.
Comment #7
David4514 CreditAttribution: David4514 commentedI may have answered my own question. As described in the #952820: Drupal 7 port, overlays are incompatible with mixed http/https mode (i.e. you cannot overlay https on top of http).
Ok... now that I understand, I can live with that. I was only having the issue in the administrative area anyway.
Comment #8
klausiPatch does not apply anymore, rerolled.
Comment #9
klausiBetter not fix the white space at the end of the file to avoid clashes with my other securepages patches in my drush make file.