This patch implements hook_requirements() for salesforce.module. Checks if HTTPS is on, and if so, if the site is authorized with Salesforce.

Comments

kostajh’s picture

Status: Active » Needs review
StatusFileSize
new2.37 KB
levelos’s picture

Status: Needs review » Needs work

We did think about this and didn't implement anything yet. The entire site does not need to be running HTTPS to use the Salesforce module, which the patch implies. It only needs to support HTTPS. My thought is to do some type of HTTPS check on the authorization page (and only there) and display appropriate messaging if it's not using HTTPS.

I also don't think we should throw a requirements error if Salesforce isn't authorized yet. Maybe a notice/warning?

kostajh’s picture

Assigned: Unassigned » levelos
Status: Needs work » Active

An error is helpful for drawing an admins attention to a problem if the site can no longer connect with Salesforce. A warning/notice would only show up in the Status Report, not on every admin page. But I'd agree that an error should not be thrown during install, and I would change the existing patch so it only shows in the runtime phase.

Regarding HTTPS, yes, let's do the check on the admin/configure/services/salesforce page only.

You want me to work on this or will you?

kostajh’s picture

Issue summary: View changes

Updated issue summary.

mariacha1’s picture

Assigned: levelos » mariacha1
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new23.03 KB
new38.47 KB
new3.05 KB

New notifications attached:

Reports page:

Reports page error example

Authorization page:

Reports page error example

Patch attached adds these.

aaronbauman’s picture

#4 didn't apply for me.
Applied manually and looks RTBC to me.

re-roll attached

dbcollies’s picture

Just something to add to the mix: I would prefer we NOT require HTTPS. Of course, I understand that HTTPS is technically required for the callback URL, but there is an easy workaround that I use for my development sites. Even though they don't support HTTPS, I list the callback URL as HTTPS anyway in Salesforce. When Salesforce tries to do the callback, I get the expected error. in my browser All I need to do is change the URL in the browser from https://... to http://... leaving everything else the same. The authorization token gets stored, and everything works just fine.

Clearly not something you want to do in production, but very handy for development. If we require HTTPS, then my trick will no longer work. :-(

Of course, I don't expect the project not to do something simply for my convenience. Just wanted to bring it up as food for thought.

aaronbauman’s picture

@dbcollies: since this is a runtime requirement, it shouldn't prevent you from installing the module and using your workaround. Can you try the patch and confirm?

  • aaronbauman committed 4ce0d78 on 7.x-3.x
    Issue #1861296 by mariacha1, kostajh, aaronbauman: Implement...
aaronbauman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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