- Posts: 103
- Thank you received: 7
Kunena 7.1.0 Released
The Kunena team has announce the arrival of Kunena 7.1.0 [K 7.1.0] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x./6.1.x./6.2.x This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 / K7.0 and issues discovered during the last development stages of K 7.1
Just a reminder: K6.4.16 receives only securities fixes until end of 2026, so it's advised for users to upgrade to K7.1.
Question Display of PDFs in messages stopped working
The thread title is in fact misleading, the real issue was that after I moved from K6.4 to K7.0, the display of PDFs in messages stopped working - both when using a 9themstore template and when using the default template.. I've now found a workround that works:
Instead of using the full path to the PDF file I edited template/system/layouts/bbcode/attachment/pdf.php to use a relative link and now everything works properly.
After line 21 I added $location = substr($location,21); to remove the first part of the URL - in my case this removes https://www,pgweb.uk/ - which is 21 characters long.
I wonder whether the cause could be some hardening of security by the developers of Joomla or one of the extensions that I use? But why have other users not encounterd this issue?
The solution that I found is not of course applicable across the board because it depends on the number of characters in the base URL for each specific website.
Edit Pinkeltje: I've changed the topic subject.
Please Log in or Create an account to join the conversation.
In your case you have setting attachment protected disabled, so this issue could be caused by SEF settings.
The method which generate URL for pdf embeded in message is here : github.com/Kunena/Kunena-Forum/blob/K6.4...aAttachment.php#L584
Do-you use the htaccess without changes in it or there is changes in it ?
I don't provide support by PM, because this can be useful for someone else.
Please Log in or Create an account to join the conversation.
- Posts: 1079
- Thank you received: 186
I checked the direct URL of one of your PDFs (/media/kunena/attachments/773/20260709_075242.pdf): it returns 200 OK with Content-Type: application/pdf, so the .htaccess doesn't seem to block the file itself.
A few things I noticed on your site:
- Your attachments aren't protected (the PDF has its normal filename), so that setting isn't the issue.
- The PDF is served correctly by your server (Content-Type: application/pdf, same origin, www redirect is fine).
- The wf-responsive classes and the ?ts= parameter on your <object> come from the Responsify plugin (by the JCE developers), not from Kunena. I tested Responsify on my own test site, though, and the PDF still displayed fine there.
Could you please:
- Restore the original pdf.php (remove your substr change)
- Clear the JCH Optimize cache and do a hard refresh (Ctrl+F5)
- If the PDF still doesn't show, open the browser console (F12) and post any error messages here, together with the rendered <object> line from the page source.
That way we can see what is actually blocking it on your site.
Please Log in or Create an account to join the conversation.
I compared the <object> line in the source with the original pdf.php file and with my edited pdf.php file. In the former case the url has a forward slash that shouldn't be there, so no wonder it's not displaying the PDF!
This is the <object> line with pdf.php unaltered
Where has that extraneous / come from? Presumably it's something that I've done somewhere (I have done a certain amount of tweaking of things over the years).
This the <object> line with my added line (PDF displays properly)
I have to confess to doing some editing to libraries/kunena/src/BBCode/KunenaBBCode.php to make some changes to how forum content is displayed on various parts of the website. However, on a development version of the website I have substituted the current version of that file from Github and it hasn't fixed the problem.
For the time being I'll stick with my edited version of pdf.php on the live website while I work on the development website to trace the source of the problem. Looks like I've caused this myself, so I can't expect the Kunena team to fix it for me!
Please Log in or Create an account to join the conversation.
- Posts: 1079
- Thank you received: 186
Or keep a log file somewhere with your changes if everything else fails.
And maybe disable JCH optimize to test. Might be the cause of your problem as well.
Please Log in or Create an account to join the conversation.