MyBB Community Forums

Full Version: [F] Copy forum - forum can have no parent
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When copying a forum it's possible to have a forum, not a category, with no parent.

To reproduce, from the forum management page, choose a normal forum, not category, click Options, and then Copy Forum. Leave everything as it is, particularly the 'Destination forum' which is 'Copy to new forum' by default, keep the new forum type as a forum, and the 'Parent Forum' as None. Give the new forum a title, and save.

[attachment=14902]

The names aren't in bold so they're just forums, but they have no parent.

Screenshot of the settings:

[attachment=14903]

Again, marked as a forum, but no parent.

If you then try and edit and/or save a forum made in this way once it's been created, you get the usual 'You must select a parent forum' error.
And what's the point in having a forum with no parent like this?
There isn't a point, it shouldn't be possible, hence it being a bug report... :|
Does it show up on the actual forum?
They don't show on the forums, no, only the forum list in the ACP.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
In admin/modules/forum/management.php find:

if($mybb->input['pid'] == 0 && $mybb->input['type'] == 'f')

replace with

if($mybb->input['pid'] == -1 && $mybb->input['type'] == 'f')
That stops it, but the error message is blank when there's no parent:

[attachment=15034]
In the same file find:

$errors[] = $lang->error_forum_noparent;

replace with:

$errors[] = $lang->error_no_parent;

Ryan
Yep, works fine for me now.