* Fix bug#29140

This commit is contained in:
zenggang
2022-11-29 06:35:11 +00:00
parent e460772fc4
commit b908e942a8
5 changed files with 14 additions and 0 deletions
+10
View File
@@ -821,6 +821,16 @@ class docModel extends model
->remove('comment,files,labels,uid,contactListMenu')
->get();
if($doc->type == 'chapter' and $doc->parent)
{
$parentDoc = $this->dao->select('*')->from(TABLE_DOC)->where('id')->eq((int)$doc->parent)->fetch();
if(strpos($parentDoc->path, ",$docID,") !== false)
{
dao::$errors['parent'] = $this->lang->doc->errorParentChapter;
return false;
}
}
if(!empty($doc->acl) and $doc->acl == 'private') $doc->users = $oldDoc->addedBy;
$oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();