News:

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

Main Menu
Support-Forum

Content Plugin Button Broken in Front End - [Fixed in 4.0.50]

Started by ghicar, 22.01.2026 10:20:28

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

ghicar

Button - jDownloads Content Ver 4.0 (type: editors-xtd) that comes packaged with jDownloads 4.0.49 is very broken when used in the front end. It works OK when used in the backend.

Whilst front end editing an article when you click the Download button you see the dialog with a few most recent downloads listed. But if you navigate to the next page or try to search for downloads the view switches to my main "jDownloads - List All Categories" menu item.

Environment:
jDownloads 4.0.49
Joomla: 5.4.2
PHP: 8.4.16
Site Template: Cassiopeia (that comes with Joomla)
Editor: JCE: 2.9.97 (free)

100% reproducible

  •  

ghicar

I don't know if this helps but looking at the queries made from the initial click of the "Download" editor and page 2 from the navigation for both frontend and backend editing of an article.

front end initial Download click:
QuoteGET   SITEURL/index.php?option=com_jdownloads&view=downloads&layout=modal&tmpl=component&f5ba...fa=1&editor=jform_articletext

backend initial Download click:
QuoteGET SITEURL/administrator/index.php?option=com_jdownloads&view=downloads&layout=modal&tmpl=component&23f1...e4=1&editor=jform_articletext

frontend selecting the second page from the navigation
QuoteGET SITEURL/index.php/component/jdownloads/downloads/all?layout=modal&tmpl=component&Itemid=1632&start=20

backend selecting the second page from the navigation
QuotePOST SITEURL/administrator/index.php?option=com_jdownloads&view=downloads&layout=modal&tmpl=component&function=jSelectDownload&23f1...e4=1&editor=jform_articletext
with POST data:
filter[search]
list[fullordering]=a.id DESC
list[limit]=20
filter[published]
filter[featured]
filter[language]
filter[level]
limitstart=20
task
boxchecked=0
forcedLanguage
23f1...e4=1

So they are quite different on the when moving to the second page in the modal.
  •  

ColinM

Hi,
Did you set 'Enabe Plugin Locally' to Yes? Also which layout did you choose in the Default Layout parameter?

Colin
Colin M
  •  

ghicar

Hi Colin

Thanks for taking a look at this.
  • Yes I had "Enable Plugin locally" set to Yes.
  • In the default layout I was using a custom layout, but have just switched to a standard supplied default template of "Files link only v3.9" and get the same issue.

This used to work fine but its been a while since I have tried from the front end to add a download link to an article from the editor download button that wasn't on the first page of the modal, so I don't know when it got broken.  I will have updated Joomla 5 and jD a few times in between.

The jD installer will not let me install earlier versions to try to zoom in on what's changed.

Is it working ok in your test environments, if yes it gives me some hope that some config change might fix it?
  •  

ColinM

Hi
This does seem strange.  I have not been able to reproduce. Also I use the Pro version of JCE.

There are two articles on the content plugin in the Modules & Plugin section of the Documentation.
Additional Aspects of Using the  the Content Plug
Introduction to jD Contentin Articles etc

Direct Links to these are given below
https://www.jdownloads.net/documentation?view=article&id=119&catid=30
https://www.jdownloads.net/documentation?view=article&id=269&catid=30

Colin
Colin M
  •  
    The following users thanked this post: Wesleylen

ghicar

#5
Hi Colin

So for me, the content plugin is fully working when used in a backend article edit. But in the front end article edit, it opens correctly and lists the first page of downloads that I can select from.  However if I go to the bottom of the modal and move to the next page, then that is when the view in the modal switches to a categories list. The same happens if I apply a filter.

Looking at the HTML src that is generated when the modal is first displayed after clicking the download button in the editor, I see the following for page 2 (and similar for other pages):

<li class="page-item">
<a aria-label="Go to page 2" href="/index.php/component/jdownloads/downloads/all?layout=modal&amp;tmpl=component&amp;Itemid=1632&amp;start=20" class="page-link">2</a>
</li>

It would be good to know what they look like from your test environment.   Itemid=1632 referred to in the href is the #__menu.id for the website home page.
  •  

ghicar

As a workaround until we get to the bottom of this, I have added {file_id} to my downloads layout so that I can see the file id and then rather than using the editor Download button we can type in the code {jd_file file==nnn} manually.
  •  

Arno

Hi,
I will check this in the next days.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  
    The following users thanked this post: Wesleylen

ghicar

The environment experiencing the issue is hosted on linux with several other 3rd party extensions and has undergone many updates to both Joomla and 3rd party extensions.

So I have installed XAMPP on a local Windows 11 PC and a fresh install of Joomla 5.4.2 and only installed plugins JCE(free) and JDownloads(4.0.49).

I made minimal changes to the jDownloads config to allow use of the content plugin and the downloads editor button.

I see the exact same problem, ie
  • I edit an article in the front end
  • Click the "download" button which opens up a modal showing the first 20 downloads.
  • If I move to page 2, or if I select some filters then it switches to a categories view rather than the all downloads
view.

  •  
    The following users thanked this post: Wesleylen

ghicar

#9
I have made some progress on this. Firstly, I discovered that the pagination in the editors-xtd plugins for the standard editor buttons +Article, Menu, Module do not work on the pagination in J!5.4.2, and they fail with an error "The most recent request was denied because it had an invalid security token. Please refresh the page and try again."

I raised this a a bug with Joomla and it is a known issue that is being discussed but there is a fix proposed but not yet agreed.

My Joomla report: https://github.com/joomla/joomla-cms/issues/46788
The suggested fix is here: https://github.com/joomla/joomla-cms/compare/5.4-dev...joomdonation:fix_invalid_token_pagination?expand=1


I applied this fix on a test system and it worked for those editor buttons but the jDownloads editor button still moved you to a category view when paging.

Next using chrome development tool, I manually adjusted the pagination links generated in the jDownload plugin from:
href="/index.php/component/jdownloads/downloads/all?layout=modal&amp;tmpl=component&amp;23f1...e4=1&amp;Itemid=1632&amp;start=20"
to
href="/index.php/component/jdownloads/downloads/all?view=downloads&amp;layout=modal&amp;tmpl=component&amp;23f1...e4=1&amp;start=20"
and this worked.  So need some assistance on how to change the pagination links or the handling thereof so that pagination works in the jDownloads button.
  •  

ghicar

#10
Following my previous post, it seems pagination is broken for all editors-xtd plugins. However as initially reported when using SEF URLs the jDownloads editors-xtd plugin does not work for either filtering the list or paging through the list. Instead, when either of these are tried the modal displays a category view instead of an all downloads view.

I have found that a small change to ~/components/com_jdownloads/src/Dispatcher/Dispatcher.php that works around the issue when SEF URLs are used, adding the code below to the dispatch()
    public function dispatch()
    {
        if(empty($this->input->get('view'))) {
            if($this->input->get('layout')==='modal'  ) {
                $this->input->set('view', 'downloads');
            }
        }

Doing this allows filtering to work. Now to me this is a workaround and I hope that someone who knows the code best can work out where the real fix should be applied.

Having applied this fix, filtering works as expected but attempts to move to another page presents the same behaviour seen by all the other editor-xtd plugins that use pagination, which is a Joomla bug in J!5.4.2
  •  

Arno

Hi,
Quote...the same behaviour seen by all the other editor-xtd plugins that use pagination, which is a Joomla bug in J!5.4.2
Thanks for the hint. I wasn't aware of that. Has this fix been implemented in the meantime?

I must apologise for not having been able to address this issue yet. The work on the new version 4.1 was very extensive and took up all my time. However, the beta was finally released today (for the test team) and I will probably start a public beta phase in a few days. 

I have just tested it again with the new version and Joomla 6.0.2 unfortunately the problem still exists. I will therefore try to fix it today. I will get back to you.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ghicar

Re
QuoteThanks for the hint. I wasn't aware of that. Has this fix been implemented in the meantime?

So, there was a suggested fix which copies the form token in pagination requests here. This fix was rejected, and indeed when I tried it, although it allowed you to move to the next page(s) upon selecting something nothing happened. So still waiting for a fix. I am hoping the report I raised here will be updated when there is a fix.
  •  

Arno

#13
Okay. Thanks for the update.

However, I have now managed to fix the problem for jDownloads. ;)
The form token was just one of the necessary adjustments.

Version 4.0.50 will be released in the next 30 minutes and contains this fix, as well as a final minor adjustment in preparation for an update to 4.1.

The installed version 4.0.50 will therefore be a prerequisite for an update to 4.1 in the future.

(Also fixed in the upcoming version 4.1.)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  
    The following users thanked this post: ghicar

ghicar

Just downloaded and tested 4.0.50 and the jDownloads editors-xtd button is working well, both applying filtering and pagination now work as expected.
  •  
    The following users thanked this post: Arno