Fix MyBB 1.8 compatibility (profile fields)
authorTim Düsterhus <tim@bastelstu.be>
Tue, 4 Aug 2015 15:06:20 +0000 (17:06 +0200)
committerTim Düsterhus <tim@bastelstu.be>
Tue, 4 Aug 2015 15:06:20 +0000 (17:06 +0200)
files/lib/system/exporter/MyBB16xExporter.class.php

index cfde28edb445321cb37e7c3d2e1d91ee5a7ad0e2..7e47d11c725548497ed36868c03ef53f830a4782 100644 (file)
@@ -410,10 +410,10 @@ class MyBB16xExporter extends AbstractExporter {
                        ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.option')->import($row['fid'], array(
                                'categoryName' => 'profile.personal',
                                'optionType' => $row['type'],
-                               'editable' => $row['editable'] ? UserOption::EDITABILITY_ALL : UserOption::EDITABILITY_ADMINISTRATOR,
+                               'editable' => ((isset($row['editable']) && $row['editable']) || (isset($row['editableby']) && $row['editableby'] == -1)) ? UserOption::EDITABILITY_ALL : UserOption::EDITABILITY_ADMINISTRATOR,
                                'required' => $row['required'],
                                'selectOptions' => $selectOptions,
-                               'visible' => $row['hidden'] ? UserOption::VISIBILITY_ADMINISTRATOR | UserOption::VISIBILITY_OWNER : UserOption::VISIBILITY_ALL,
+                               'visible' => ((isset($row['hidden']) && $row['hidden']) || (isset($row['profile']) && !$row['profile']) || (isset($row['viewableby']) && $row['viewableby'] != -1)) ? UserOption::VISIBILITY_ADMINISTRATOR | UserOption::VISIBILITY_OWNER : UserOption::VISIBILITY_ALL,
                                'showOrder' => $row['disporder']
                        ), array('name' => $row['name']));
                }