Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2021-01-09 00:53:13

Elementair
Member
Registered: 2020-02-28
Posts: 39

moderators move topics - empty list of topics

Hi.
I m facing an issue where if a moderator want to move a topic,
the drop down list to choose the section to move to is empty .

a35dbe3cc9c459e8bcd1a43418c289c2.jpg

No issue with administrator privilege, just for moderators: the list is always empty.

If I want to move a post as a moderator, the topic drop down list is empty too.

Offline

#2 2021-01-09 12:07:43

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

I tried the original moderate.php, to see if one of my mods would have cause this but result is the same.

Could someone indicate in which place this list is generated ?

Here is what I should see as moderator ( and what I see as admin )
aefcab6392098c40507c69e4eda6c65b.jpg

Offline

#3 2021-01-09 13:27:33

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,465
Website

Re: moderators move topics - empty list of topics

Give the moderator rights to multiple forums and check again.

query https://github.com/fluxbb/fluxbb/blob/m … e.php#L489
print https://github.com/fluxbb/fluxbb/blob/m … #L516-L530

Offline

#4 2021-01-09 14:52:05

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

Thanks for your help !

I already tried with a new moderator, giving moderation right to multiple forums, with no success.

I also tried a fresh moderate.php, no success either, same behaviour.

From what I can understand from your links, I don't see any difference in the list generation between moderator and admin.
I have no warning of "Nowhere to move", meaning the list is not empty. It 's just not displaying...
I'll have to search a bit more.

Edit: I tried with "moderate.php" from you link and it's working as it should. Perfect.

Offline

#5 2021-01-09 15:18:45

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,465
Website

Re: moderators move topics - empty list of topics

And before that, what version did you use, where moderate.php does not work correctly?
Was this the original FluxBB or my build? And the version number?

Offline

#6 2021-01-09 19:52:16

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

I tried to compare each version to have a better idea:

- The version I used to use was a 1.5.11 original where I added a lot of the github improvement ( using with php7.2)
- I then tried a original 1.5.11 wich was doing same result

- Then I gave a go to the file you pointed, and it surprised me but it seems to do the job.

The version I used was not far from it, you can take a look here
https://controlc.com/3a9b5274

Offline

#7 2021-01-11 00:07:39

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

So I kept the github master branch where the list was diplayed:
- had to clean the has_row and generate_crumb for which my forum doesn't have support yet.

The only difference with my file was line 501 to 506

 
	$forums = array();
	while ($row = $db->fetch_assoc($result))
		$forums[] = $row;

	if (count($forums) < 2)

instead of

 if ($db->num_rows($result) < 2)

and line 528

 foreach ($forums as $cur_forum)

instead of

 while ($cur_forum = $db->fetch_assoc($result))

and with this changes, moderators have the drop down list filled when moving topics.

everything works as intended , except the split fonction, same issue.
working perfect for administrator, "move to" drop down list is empty for moderator.

By looking at code, I can see the same while loop .
So I added

 $forums = array();
	while ($row = $db->fetch_assoc($result))
		$forums[] = $row;

on line 220

and replaced the while loop line 241 by

 foreach ($forums as $cur_forum) 

and... Tada !! drop down list is filled for moderator.

I'm way beyond my understanding but this seem to do the trick.
Seem the While loop is kind of buggy, I suppose it's the same for everyone, kind of a bug ?

Offline

#8 2021-01-11 03:50:44

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,465
Website

Re: moderators move topics - empty list of topics

There is no error in the while loop.
You cannot use one file from one version and all others from another.

Offline

#9 2021-01-11 11:30:16

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

I just used the other version file as a "whynot"  desperate test... and the drop down list magicaly appear for moderator.
(other functions where not working).

I don't fully understand the php/sql stuff, but i'm not dumb either.

By comparing the two files

The issue is/was this while loop, don't know why...

With one the drop down list appear only for admin, with my modification both admin and moderator can use the split and move moderation functionnality.

I'd like to understand why,  but anyway i'll leave it like that: everything is working as it should, I'll  understand another day.

I'll try with an all new forum when I'll got time  to see if it's a bug in 1.5.11 version

Last edited by Elementair (2021-01-11 11:33:14)

Offline

#10 2021-01-11 12:15:38

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,465
Website

Re: moderators move topics - empty list of topics

Maybe had PHP or MySQL updated and after that a glitch appeared?

Offline

#11 2021-01-11 12:28:51

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,465
Website

Re: moderators move topics - empty list of topics

The problem with while() may be that, for some reason, the internal pointer $result is shifted to the end, as a result of iterating over the strings, there are no strings, false is returned immediately.

Before the problematic

while ($row = $db->fetch_assoc($result))

add

mysqli_data_seek($result, 0);

for test.

Offline

#12 2021-01-11 13:03:23

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

I don't know when the glitch appeared cause I tested all those fonctions with the admin account, never really tried with the moderator account.
One of the moderators tried to move a discussion last week and discover this.
I suspect the glitch is here since update from 1.2.16 to 1.5.11 in March 2020.

I tried to add 

 mysqli_data_seek($result, 0);

with no result; admin can see the drop down list, moderator can't

Offline

#13 2021-01-11 13:08:55

Elementair
Member
Registered: 2020-02-28
Posts: 39

Re: moderators move topics - empty list of topics

The problem is I don't see any difference between moderator and admin from the point of this loop.

I should try to make a dump of that list to see what's in it when a moderator use it. (maybe there's a buggy character that prevent the display).

Offline

Board footer

Powered by FluxBB