Kunena / Kunena-Forum

Kunena Forum - Forum / Bulletin Board / Discussions component for Joomla - This is the 6.x/5.x main development branch. Please do not open issues regarding earlier versions of Kunena
https://www.kunena.org
GNU General Public License v3.0
1.75k stars 812 forks source link

Kunena 6.3.5 update prevents attachi to post. #9746

Closed makitso closed 1 month ago

makitso commented 1 month ago

Kunena 6.3.5, Php 8.3, Joomla 5.1.4 Updated site to Kunena 6.3.5. Now, if a user wants to reply to post, the Attachments block is no longer shown.

new image 0ld image

makitso commented 1 month ago

if you change: /components/com_kunena/src/Controller/Topic/Form/Reply/TopicForumReplyDisplay.php replace line 201 $this->UserCanPostImage = $this->me->checkUserAllowedLinksImages(); with if ($this->config->new_users_prevent_post_url_images && $this->me->posts < $this->config->minimal_user_posts_add_url_image) { $this->UserCanPostImage = false; } this fixes reply. If you change: /components/com_kunena/src/Controller/Topic/Form/Edit/TopicForumEditDisplay.php replace line 220 $this->UserCanPostImage = $this->me->checkUserAllowedLinksImages(); with if ($this->config->new_users_prevent_post_url_images && $this->me->posts < $this->config->minimal_user_posts_add_url_image) { $this->UserCanPostImage = false; } this fixes edit.

xillibit commented 1 month ago

It's not a bug, it depends on these settings under security tab : image

makitso commented 1 month ago

My display is different than yours. I do not have that box set to No

image

xillibit commented 1 month ago

I have tried by using these settings with an user which 8 posts actually, it displays the part to add attachment: image

makitso commented 1 month ago

If I set the options as below then a regular registered user can add attachments. However, an admin user can not add an attachment. Also, I am using not using the CAPTCHA - hCaptcha plugin but i instead the CAPTCHA - Invisible reCAPTCHA plugin.

image

xillibit commented 1 month ago

I have tried like that in admin i have the attachments part which is displayed

makitso commented 1 month ago

It fails for me as an administrator. It worked just fine with 6.3.4 and fails with 6.3.5.

rich20 commented 1 month ago

I have also tried everything, but cannot confirm this error. Could it perhaps be related to this? https://github.com/Kunena/Kunena-Forum/issues/9742

makitso commented 1 month ago

Yes, same problem.

makitso commented 1 month ago

If I look at /libraries/kunena/src/User/KenenaUser.php, and I am logged in as a moderator or administrator, why is line 2436 setting a return as false? So, if you change line 2436 to true and change && in line 2439 to || it works?

image

xillibit commented 1 month ago

Are-you using Aurelia template ? This check works for both admin and mod

The method checkUserAllowedLinksImages() wasn't changed in my commit on K6.3.5, the return should reversed.

makitso commented 1 month ago

Yes, I am using the Aurelia template. However, this instance of Joomla/Kunena is quite old, having started around 2010.

makitso commented 1 month ago

The method checkUserAllowedLinksImages() wasn't changed in my commit on K6.3.5, Is it possible that checkUserAllowedLinksImages() was broken before your patch?

makitso commented 1 month ago

I spun up a clean copy of Joomla and Kunena with test data. You are correct, the code works correctly in that test environment. Can you suggest anything that might help me figure out what my installation has that is preventing my tests from workiing?

makitso commented 1 month ago

I use an Aurelia override (copy Aurelia code to my template html folder ) to change some of the editor buttons.
Unfortunatly, I was remis in that I did not update the original code to current levels. When I did the problem was solved.