www.jdownloads.com

0 Members and 1 Guest are viewing this topic.

Hi all,

with our main installation of Joomla! 4.3.4 + jDownloads 4.0.29 I have the problem that public download categories aren't visible when not logged in. This used to work before, e.g. here
https://www.ias-observatory.org/index.php/de/publikationen/category/4-pub
(menu item single category)
Tested updating to jDownloads 4.0.31 in our staging environment, which results in downloads no longer accessible even to logged in users and showing the error message "implode() expects at most 2 arguments, 3 given" e.g. here
https://beta.ias-observatory.org/index.php/de/publikationen

Any solutions? Thanks. (The site was migrated from Joomla! 3 to 4 some time ago via jDownloads 3.9.) Alas, the previous jDownloads releases aren't available for for back tracking.

Martin

« Last Edit: 04.10.2023 10:12:22 by ColinM »
*
Hi,
please update at first to 4.0.31.
Try it then again.
Should the problem be still üpresent, activate the Joomla debug option in config and try it again. Post then the more detailed debug information here or send it me as PM. Thanks.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
Thanks for the quick response. beta has already been updated to 4.0.31, here's with debug output:
https://beta.ias-observatory.org/index.php/de/publikationen

     implode() expects at most 2 arguments, 3 given

Call stack
#    Function    Location
1    ()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
2    implode()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
3    JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->_load()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:186
4    JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->get()    JROOT/components/com_jdownloads/src/Model/CategoriesModel.php:221
5    JDownloads\Component\JDownloads\Site\Model\CategoriesModel->getItems()    JROOT/libraries/src/MVC/View/AbstractView.php:146
6    Joomla\CMS\MVC\View\AbstractView->get()    JROOT/components/com_jdownloads/src/View/Categories/HtmlView.php:81
7    JDownloads\Component\JDownloads\Site\View\Categories\HtmlView->display()    JROOT/libraries/src/MVC/Controller/BaseController.php:645
8    Joomla\CMS\MVC\Controller\BaseController->display()    JROOT/components/com_jdownloads/src/Controller/DisplayController.php:123
9    JDownloads\Component\JDownloads\Site\Controller\DisplayController->display()    JROOT/libraries/src/MVC/Controller/BaseController.php:678
10    Joomla\CMS\MVC\Controller\BaseController->execute()    JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
11    Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()    JROOT/components/com_jdownloads/src/Dispatcher/Dispatcher.php:60
12    JDownloads\Component\JDownloads\Site\Dispatcher\Dispatcher->dispatch()    JROOT/libraries/src/Component/ComponentHelper.php:361
13    Joomla\CMS\Component\ComponentHelper::renderComponent()    JROOT/libraries/src/Application/SiteApplication.php:208
14    Joomla\CMS\Application\SiteApplication->dispatch()    JROOT/libraries/src/Application/SiteApplication.php:249
15    Joomla\CMS\Application\SiteApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:293
16    Joomla\CMS\Application\CMSApplication->execute()    JROOT/includes/app.php:61
17    require_once()    JROOT/index.php:32
Additional remark as this seems to be language related ... 'currentlang': the site is multi-lingual (DE, EN), but the download categories are not language specific, all set to Category Language = "Alle".
*
Bitte installiere die Version 4.0.32. Der Bug sollte damit behoben sein.
Danke.  :)

----------------------------------

Please install version 4.0.32. This should fix the bug.
Thank you.  :)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
Thanks for the quick turn-around, but now it's a different error:
https://beta.iasev.de/index.php/de/publikationen

     implode(): Argument #2 ($array) must be of type ?array, string given

Call stack
#    Function    Location
1    ()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
2    implode()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
3    JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->_load()    JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:186
4    JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->get()    JROOT/components/com_jdownloads/src/Model/CategoriesModel.php:221
[...]

Removing this piece of code solves both the original problem and the error:
//        if ($this->_options['currentlang'] !== 0) {
//            $subQueryCat->where(
//                $db->quoteName('cat.language')
//                . ' IN (' . implode(',', $this->_options['currentlang']));
//        }
Did some debugging:
$this->_options['currentlang'] is a string "de-DE" or "en-GB"
« Last Edit: 28.09.2023 10:08:19 by mj_jdl »


Hi! Since Update today to 4.0.32 I have the same problem!!

implode(): Argument #2 ($array) must be of type ?array, string given

Call stack
#   Function   Location
1   ()   JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
2   implode()   JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397
3   JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->_load()   JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:186
4   JDownloads\Component\JDownloads\Site\Helper\CategoriesHelper->get()   JROOT/components/com_jdownloads/src/Helper/RouteHelper.php:108
5   JDownloads\Component\JDownloads\Site\Helper\RouteHelper::getOtherRoute()   JROOT/plugins/content/jdownloads/jdownloads.php:1389
6   jd_file_fill_downloadok()   JROOT/plugins/content/jdownloads/jdownloads.php:546
7   jd_file_createdownload()   JROOT/plugins/content/jdownloads/jdownloads.php:272
8   jd_file_callback()   
9   preg_replace_callback()   JROOT/plugins/content/jdownloads/jdownloads.php:200
10   PlgContentJDownloads->onContentPrepare()   JROOT/libraries/src/Plugin/CMSPlugin.php:284
11   Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()   JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
12   Joomla\Event\Dispatcher->dispatch()   JROOT/libraries/src/MVC/View/AbstractView.php:249
13   Joomla\CMS\MVC\View\AbstractView->dispatchEvent()   JROOT/components/com_content/src/View/Article/HtmlView.php:227
14   Joomla\Component\Content\Site\View\Article\HtmlView->display()   JROOT/libraries/src/MVC/Controller/BaseController.php:645
15   Joomla\CMS\MVC\Controller\BaseController->display()   JROOT/components/com_content/src/Controller/DisplayController.php:121
16   Joomla\Component\Content\Site\Controller\DisplayController->display()   JROOT/libraries/src/MVC/Controller/BaseController.php:678
17   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
18   Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()   JROOT/components/com_content/src/Dispatcher/Dispatcher.php:56
19   Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch()   JROOT/libraries/src/Component/ComponentHelper.php:361
20   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/SiteApplication.php:208
21   Joomla\CMS\Application\SiteApplication->dispatch()   JROOT/libraries/src/Application/SiteApplication.php:249
22   Joomla\CMS\Application\SiteApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:293
23   Joomla\CMS\Application\CMSApplication->execute()   JROOT/includes/app.php:61
24   require_once()   JROOT/index.php:32
*
Hi
I confirm that as mj_jdl discovered then a temporary fix is commenting out lines 394 to 397 of JROOT/components/com_jdownloads/src/Helper/CategoriesHelper.php:397 solves the multilang associatiom problem.

//        if ($this->_options['currentlang'] !== 0) {
//            $subQueryCat->where(
//                $db->quoteName('cat.language')
//                . ' IN (' . implode(',', $this->_options['currentlang']));
//        }

Colin
Colin M
Yes, this works - Thank You!
*
Sorry again for my mistake.  :-\
I am today on the road and not in my office. So I can not test anything today.
But I will publish in the next hour another try.  ::) :-\
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
No problem and thanks for looking into this. To help with the debugging: in my case cat.language is "*" and currentlang is either "de-DE" or "en-GB".
*
Have you not tried the latest version 4.0.33?
Please test this and post here your result (with activated System - Language Filter plugin).
Thanks.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
Sorry, didn't notice the 33 update until now. It now "sort of" works, with a very strange phenomenon.
Staging Website https://beta.iasev.de/index.php/de/

When the menu entry "Publikationen" points to jDownloads > "Alle Kategorien anzeigen (Standard)", entry "Allgemeine Informationen" to "Einzelne Kategorie anzeigen" (public category) this works as expected. When no user is logged in, only the PUBLIC jDownloads categories are shown.
If I switch the "Publikationen" entry to point to a single category with the very same name "Publikationen" (public category), then *both* the entry "Publikationen" and "Allgemeine Informationen" throw the following error:

404 Seite nicht gefunden

Call stack
#    Function    Location
1    ()    JROOT/libraries/src/Router/Router.php:155
2    Joomla\CMS\Router\Router->parse()    JROOT/libraries/src/Application/SiteApplication.php:746
3    Joomla\CMS\Application\SiteApplication->route()    JROOT/libraries/src/Application/SiteApplication.php:232
4    Joomla\CMS\Application\SiteApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:293
5    Joomla\CMS\Application\CMSApplication->execute()    JROOT/includes/app.php:61
6    require_once()    JROOT/index.php:32

If I login as any user with the "Registered" access level, both links work as expected.

Currently the menu entry "Publikationen" points to Link "index.php?option=com_jdownloads&view=category&catid=4"
Addendum: which BTW is the very same behavior / original problem I get on our main Website with jDownloads 4.0.29!
https://www.ias-observatory.org/index.php/de/

Here I switched "Allgemeine Informationen" to show all categories. This also works as expected and shows only the public categories when not logged in.

(System - language filter is enabled, yes)