* [story #69914] move book lib to default space.

This commit is contained in:
sunhao
2025-01-09 15:41:13 +08:00
committed by 丁永亮
parent e83a8d3d54
commit b9841c14f0
+15
View File
@@ -900,6 +900,7 @@ class docModel extends model
}
$modules = array();
$wikiLibs = array();
foreach($chapters as $chapterID => $chapter)
{
$module = new stdClass();
@@ -916,6 +917,7 @@ class docModel extends model
$moduleID = $this->dao->lastInsertID();
$module->id = $moduleID;
$modules[$moduleID] = $module;
$wikiLibs[] = $chapter->lib;
$chapter->module = $moduleID;
$chapter->parentChapter = isset($chapters[$chapter->parent]) ? $chapters[$chapter->parent] : null;
@@ -949,6 +951,19 @@ class docModel extends model
$this->dao->update(TABLE_MODULE)->set('path')->eq($module->path)->set('parent')->eq($module->parent)->where('id')->eq($module->id)->exec();
}
/* Move wiki libs to the migrated wiki space. */
foreach($wikiLibs as $libID)
{
$this->dao->update(TABLE_DOCLIB)
->set('parent')->eq($wikiSpace->id)
->set('type')->eq('custom')
->where('id')->eq($libID)
->exec();
}
if(dao::isError()) return false;
return true;
}
/**