Can't reproduce 0 ucfirst(): Argument #1 ($string) must be of type string, array given

More
1 day 16 hours ago #3590 by Dmitrijs Rekuns
Hi Ruud,

There is an issue. Joomla 6.1.1, please open SEF plugin and enable strict routing. As the result, download links are no longer working (download button in the module) and I get the following error:0 ucfirst(): Argument #1 ($string) must be of type string, array given
Let me explain the architecture.
There was an old module for RDSubs which was adapted to ochSubs. the module displays a list of available files to download and we insert the module into article and made menu item.
All works fine.
But when I enable Strict routing mode in SEF plugin, we get the error mentioned above.

ochSubscriptions 5.4.1, Joomla 6.1.1, php 8.4.

Thank you.

Please Log in to join the conversation.

More
1 day 13 hours ago #3591 by Ruud van Lent
Hi,
unfortunately I cannot reproduce. Note: I do not support rd-subs or modules that I didn't develop or that are altered.

I have tested the following to confirm that it is working correct:
  • I have an article with its own menu entry
  • on that article I used the ochSubscriptions Tools content plugin to add the files in a category: these then render as tiles with a download button for each file
  • I have configured the system - SEF plugin as you have done on your site
  • when clicking the downloadbutton in that article, the file downloads: no issue

Please Log in to join the conversation.

More
1 day 13 hours ago #3592 by Dmitrijs Rekuns
The path for download is "index.php?option=com_ochsubscriptions&task=download.file&id=21".

In strict routing mode there are such headers to process the download:

Request URL lala.com/index.php?option=com_ochsubscri...=download.file&id=21
Request Method GET
Status Code 301 Moved Permanently

Request URL lala.com/?option=com_ochsubscriptions&task=download.file&id=21
Request Method GET
Status Code 301 Moved Permanently

Request URL
lala.com/component/ochsubscriptions/download.file/21
Request Method GET
Status Code 500 Internal Server Error


Error 500 comes from JROOT/components/com_ochsubscriptions/src/Service/Router.php:293

When strict routing is disabled the headers are the same except the last redirect to  lala.com/component/ochsubscriptions/download.file/21:

Request URL lala.com/index.php?option=com_ochsubscri...=download.file&id=21
Request Method GET
Status Code 301 Moved Permanently

Request URL lala.com/?option=com_ochsubscriptions&task=download.file&id=21
Request Method GET
Status Code 200 OK

Please Log in to join the conversation.

More
1 day 13 hours ago #3593 by Dmitrijs Rekuns
One more note - Strict handling of index.php also is enabled.

Please Log in to join the conversation.

More
1 day 13 hours ago #3595 by Ruud van Lent

The path for download is "index.php?option=com_ochsubscriptions&task=download.file&id=21".

 

try this: index.php?option=com_ochsubscriptions&view=download&task=file&id=21

Please Log in to join the conversation.