Closed (fixed)
Project:
Invoice
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Mar 2011 at 14:24 UTC
Updated:
22 Jun 2011 at 15:27 UTC
When a drupal site uses https:// instead of http:// ajax requests are not fired within the invoice edit form.
The cause is in invoice.js: invoice.getUrl()
I've created a patch that uses the current protocol to generate the URL by getting it from window.location.href.
Comments
Comment #1
der_On commentedgetUrl: function(path) {
//bugfix: make comatible to websites using https, by determining the protocol from the current URL.
var protocol = window.location.href.split('://')[0];
var url = protocol+"://"+ Drupal.settings['invoice']['host'] + Drupal.settings['basePath'];
if (!Drupal.settings['invoice']['clean_urls']) {
url += '?q=';
}
url += path;
return url;
}
Comment #2
der_On commentedAnd an addition to the same problem. Loading CSS files in HTTPS environment wont work either so here is a patch for invoice_helpers.inc function _invoice_get_html()
function _invoice_get_html($invoice_number, $node = null, $type = 'print') {
if (is_null($node)) {
$nid = db_result(db_query("SELECT nid FROM {invoice_invoices} WHERE iid=%d", $invoice_number));
$node = node_load($nid);
}
//bugfix: css wont be loaded on HTTPS sites, so define the protocol.
if (!empty($_SERVER['HTTPS'])) $protocol = 'https'; else $protocol = 'http';
$html = '
';
$html = '';
$html .= '
invoice['template'] .'.css" />';
$html .= '
$html .= theme('invoice_body', $node, $type);
// The eurosign is not supported as applicable character, so replace it with a ascii code
$html = str_replace('€', '', $html);
$html .= '
';
return $html;
}
Comment #3
pietervogelaar commentedFixed this issue in the Drupal 7 version.
Pieter