Closed yuliu closed 4 years ago
Seems MyBB itself can't reset such values to correct ones at AdminCP by directly editing forum X's properties. The only way to fix this at AdminCP is to set forum X as a child forum of another forum and reset its parent to "None".
Looks like a well-run MyBB forum won't have such issues and the parentlist
will only be updated upon changing a forum's parent https://github.com/mybb/mybb/blob/mybb_1822/admin/modules/forum/management.php#L1399 . Needs an issue of enhancement being created?
For anyone who has already merged their MyBB forums and suffers from this bug, either of following methods for correcting would work:
Manually set the parent forums of affected forums (root categories) to another one other than "None" and re-set back their parent forums to "None".
Run this SQL query in your MyBB database: UPDATE mybb_forums SET parentlist = fid WHERE pid = 0
(replace mybb_
with your table prefix).
Issue:
The
parentlist
field of a merged typec
(category) forum is the old value from the old database. One potential bug I can find currently due to this issue for the final merged forum is about forum password:then, no matter or not X has a password, it'll need a password for entering X.
Cause:
Since MyBB Merge Module doesn't have a categories module, all forums are merged by the forums module. In the MyBB's forums module, all data fields from the old database will be imported as what they are except that each forum's parent ID (
pid
) will be set to0
for thecleanup()
to work. However, none of them will take care of imported root categories.There are two
cleanup()
s:parentlist
) from MyBB's forums module;In a proper MyBB installation, each type
f
forum is sorted as a child forum of a typec
category forum, so in a MyBB merge, the secondcleanup()
will actually done nothing. While the firstcleanup()
will just exclude such root categories from being processed (import_pid
will be0
for them) https://github.com/mybb/merge-system/blob/bd7fd6b87d64ed568d6d28867e8c61e2ab38c607/boards/mybb/forums.php#L103 Anyway, the firstcleanup()
that make use ofmake_mybb_parent_list()
will probably fail when processing a root category.Solution:
Set
parentlist
field's value of a root category to its newfid
after it's imported.