Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving forum post blank page #3619

Closed
mostym opened this issue Jan 14, 2019 · 15 comments
Closed

Moving forum post blank page #3619

mostym opened this issue Jan 14, 2019 · 15 comments
Labels
plugin: forum type: bug A problem that should not be happening
Milestone

Comments

@mostym
Copy link

mostym commented Jan 14, 2019

When I try and move a forum thread the page that I get redirected to is blank. Any idea what's causing this? I am running the most current github branch. Thanks!

@Moc Moc added the type: bug A problem that should not be happening label Jan 14, 2019
@Moc Moc added this to the e107 2.2.0 milestone Jan 14, 2019
@Moc
Copy link
Member

Moc commented Jan 14, 2019

Just making some notes while trying to figure this out. May be related to userclass permissions issue:
#3525 and #3550

Clean install:

  • Main Site Administrator (created during install) has no value for user_class in user table
  • $moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post);
    returns empty array (var_dump gives array(0) { })
  • public function getModeratorUserIdsByPostId($postId)
    query gets no results.
  • forum_moderator set to 254
  • e_UC_MAINADMIN is 250
  • e_UC_ADMIN is 254

@Moc
Copy link
Member

Moc commented Jan 14, 2019

@phibel You did a lot of work on this specific area (https://github.com/e107inc/e107/commits?author=phibel). Could you look into why a Main Site Administrator is not able to move forum posts on a clean install?

@Moc
Copy link
Member

Moc commented Jan 14, 2019

Query gets no results because $postID = 0.

I think this:

$moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post);

needs changing to:

$moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->id);

@SimSync
Copy link
Contributor

SimSync commented Jan 14, 2019

Did a quick look into it and the methods to move the thread always look for a constant named MODERATOR being set. If not, moving is not allowed.
Did here some local changes do allow the Main Admin always to move threads.
This works currently. But i will also check if modifiying getModeratorUserIdsByPostId($this->id) will also do the trick.

@SimSync
Copy link
Contributor

SimSync commented Jan 14, 2019

getModeratorUserIdsByPostId($this->id) doesn't work, because $this->id contains the threadid and not the postid.
Switched to getModeratorUserIdsByThreadId($this->id) to receive the moderators for the thread. This worked and included also the userid of the main admin.

SimSync added a commit to SimSync/e107 that referenced this issue Jan 14, 2019
In case the post id is not set use the thread id to look
for the moderator ids
@phibel
Copy link
Contributor

phibel commented Jan 14, 2019

All my test users were a member of the moderator class of the thread/forum, so I think thats why I did not run into this problem. I will try to look at it until Wednesday @Moc.

@mostym
Copy link
Author

mostym commented Jan 15, 2019

Are you saying that i have to create a group called MODERATOR?

@mostym
Copy link
Author

mostym commented Jan 15, 2019

Welp, that didn't work...

@mostym
Copy link
Author

mostym commented Jan 15, 2019

So from seeing this, I can't have different groups managing specific forums. That kinda defeats the point of having forum permissions, no?

@Moc
Copy link
Member

Moc commented Jan 15, 2019

@BigBoiJefe no, just hang on a little longer. There is a bug in the core code which causes this issue.

SimSync added a commit to SimSync/e107 that referenced this issue Jan 16, 2019
@SimSync
Copy link
Contributor

SimSync commented Jan 16, 2019

I think my last commit should fix this issue. PR #3620 is submitted.

@phibel
Copy link
Contributor

phibel commented Jan 16, 2019

The solution from @SimSync looks good to me, I tested it in my installation.

@Moc
Copy link
Member

Moc commented Jan 16, 2019

Once the LANs are fixed, I'll merge in the fix.

Moc added a commit that referenced this issue Jan 16, 2019
issue #3619: Missing moderator ids on forum move
@Moc
Copy link
Member

Moc commented Jan 16, 2019

@BigBoiJefe You can try and test now with the latest files. The issue should be fixed.

@mostym
Copy link
Author

mostym commented Jan 16, 2019

@Moc confirmed working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: forum type: bug A problem that should not be happening
Projects
None yet
Development

No branches or pull requests

4 participants