News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

A couple of suggested patches [fixed in 3.9.8]

Started by dr236, 14.12.2020 19:43:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dr236

Hello

I've found I need the following patch (to jd3.9.7.2):

diff --git a/htdocs/administrator/components/com_jdownloads/views/downloads/view.html.php b/htdocs/administrator/components/com_jdownloads/views/downloads/view.html.php
index 87a5a34a..b13d32b5 100644
--- a/htdocs/administrator/components/com_jdownloads/views/downloads/view.html.php
+++ b/htdocs/administrator/components/com_jdownloads/views/downloads/view.html.php
@@ -131,7 +131,7 @@ class jdownloadsViewDownloads extends JViewLegacy
         }
     
         // We need icomoon font
-        $doc->addStyleSheet($this->baseurl.'/media/jui/css/icomoon.css');
+        $doc->addStyleSheet(\JUri::root(true).'/media/jui/css/icomoon.css');
   
         // We don't need toolbar in the modal window.
         if ($this->getLayout() !== 'modal' && $this->getLayout() !== 'modallist') {


for the icomoon css to be loaded from the downloads view in the backend (as baseurl in the backend is under administrator/).

Also, for some reason, my site that uses jdownloads (hosted at gandi.net) seems to be blocked from www.jdownloads.net. Unfortunately, this causes the backend views of eg downloads and categories to block for 60s (ie the default php default_socket_timeout value) due to the call to JDownloadsHelper::existsHelpServerURL in the relevant view methods.

I have patched JDownloadsHelper::existsHelpServerURL as follows to avoid this problem:

diff --git a/htdocs/administrator/components/com_jdownloads/helpers/jdownloads.php b/htdocs/administrator/components/com_jdownloads/helpers/jdownloads.php                                                                           
index cb36e049..6489ccce 100644
--- a/htdocs/administrator/components/com_jdownloads/helpers/jdownloads.php
+++ b/htdocs/administrator/components/com_jdownloads/helpers/jdownloads.php
@@ -2262,8 +2262,15 @@ class JDownloadsHelper

     public static function existsHelpServerURL($help_url)
     {

+        $default_socket_timeout_old = ini_set('default_socket_timeout',1);
+        if ($default_socket_timeout_old === false) {
+            return false;
+        }

         $file_headers = @get_headers($help_url);
+
+        ini_set('default_socket_timeout',$default_socket_timeout_old);

         if (!$file_headers || $file_headers[0] != 'HTTP/1.1 200 OK') {
             return false;


Thanks, David
  •  

ColinM

David,
Thanks for the useful inputHave sent you a PM askig a couple of clarifications
Colin
Colin M
  •  

dr236

Are these patches (which I needed for jd3.9.7.2) likely to be incorporated into a future version? I just installed jd3.9.7.3, which doesn't include them, so I had to apply the patches again by hand.

David
  •  

ColinM

David,

The second patch is not required in jD3.7.3  Will advise Arno about the first patchColin
Colin M
  •  

dr236

I do still need the second patch, unfortunately.

David
  •  

ColinM

DavidIn 3.9.7.3 the help buttons are  not meant to link to the jD documentation site but only locally.

Are you saying that without the second patch you still get the timeout?
Also for clarification I understand from your 2nd patch that 3.7.2 successfull accesed the jD documentation site.  Is that correct?
Best wishes
Colin
Colin M
  •  

dr236

I still get the timeout without the second patch.

As far as I can see (when eg viewing downloads in the backend):

administrator/components/com_jdownloads/views/downloads/view.html.php line 227 calls
JDownloadsHelper::existsHelpServerURL($help_url="https://www.jdownloads.net/index.php?option=com_content&view=article&id=135&tmpl=jdhelp")

but my production server (for some reason) is blocked from www.jdownloads.net, and so the call to get_headers() in existsHelpServerURL() blocks.

My patch means the call to existsHelpServerURL() still fails (so the "help" link just links to a generic help page), but at least it does not block for 60s.

David
  •  

ColinM

Hi
Yes it does look like we need to use something like your patch!  In jd3.9.7.3 I thought that  all thehelp options now related to a an internal page thus avoiding the problem.  But not actually giving the real help as intended :(

We are working on a 3.9.8 release so I hoe we can add in a suitable solution as you describe.
Colin
Colin M
  •  

Arno

Hi David,
excuse me for the delay. Your help url patch will be of course a part from 3.9.8.  ;)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •