Not Solved Clean install: Delete button doesn't appear in php 8.3
#1
Not Solved
Hello, after updating php 7.4 to 8.3, my users reported that the delete button no longer appears in the post.

so I did a local test using clean install without plugin with just 2 posts and 2 users.
In php 7.4 the Delete button appears normally, but when switched to php 8.3 the Delete button disappears for the normally user (registred), for the admin button it appears regardless of the version

same page, just switched php version

Php 7.4
   

Php 8.3
   

Is there anything I need to do in ACP?
Reply
#2
Not Solved
I tested with PHP 8.3.6 and Mybb last version, there is not problem , so Make sure the installed PHP 8.3 is installed correctly , also ask multiple user with delete permission to check this, because some times you recently changed that usergroup permissions and he still see pages with old cache (so also clear mybb cache) , also maybe you have a plugin to effect on delete premission and that plugin have a function that which is deprecated in version 8.3 .
if you have PHP knowledge you can add a log code for postbit_quickdelete template condtions in inc/functions_post.php and find which one return false in PHP 8.3 and follow step by step and find wihch line have problem then you can share here for more help.









Note : If you don't find your solution, I can check your server and code and fix the problem if you want  (non-free)
Reply
#3
Not Solved
(2024-11-14, 01:38 AM)Mostafa.Shiraali Wrote: I tested with PHP 8.3.6 and Mybb last version, there is not problem , so Make sure the installed PHP 8.3 is installed correctly , also ask multiple user with delete permission to check this, because some times you recently changed that usergroup permissions and he still see pages with old cache (so also clear mybb cache) , also maybe you have a plugin to effect on delete premission and that plugin have a function that which is deprecated in version 8.3 .
if you have PHP knowledge you can add a log code for postbit_quickdelete template condtions in inc/functions_post.php and find which one return false in PHP 8.3 and follow step by step and find wihch line have problem then you can share here for more help.









Note : If you don't find your solution, I can check your server and code and fix the problem if you want  (non-free)

Thanks to check. The production one is Almalinux, and the test with clean installation is on Windows. They are totally different environments and they have the same problem. On Windows, clean installation without plugins using WampServer 3.3.2 application. Maybe some PHP component is missing, I don't know.

samething in XAMPP with php 8.2 clean install with 2 users only (administrator and one registred), and 2 posts only. Doesn't appear Delete button for Registred user in own post.

   

   

   

   

   

   

   

   

   

   

I found the cause of the problem

line 613 of functions_post.php

if($mybb->user['uid'] == $post['uid'] && $thread['closed'] == 0)

the conditional is $thread['closed'] == 0

but on DB is empty and not value = 0 to closed column

   

so i changed line 613 of functions_post.php to below and problem fixed

if($mybb->user['uid'] == $post['uid'] && ($thread['closed'] == 0 || empty($thread['closed'])))

https://stackoverflow.com/questions/6602...n-previous
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)