* [refac] fix doc->update not work in extensions.
This commit is contained in:
@@ -640,7 +640,7 @@ class doc extends control
|
||||
->removeIF($this->post->product === false, 'product')
|
||||
->removeIF($this->post->execution === false, 'execution')
|
||||
->get();
|
||||
$result = $this->doc->update($docID, $docData, $doc);
|
||||
$result = $this->doc->update($docID, $docData);
|
||||
if(dao::isError())
|
||||
{
|
||||
if(!empty(dao::$errors['lib']) || !empty(dao::$errors['keywords'])) return $this->send(array('result' => 'fail', 'message' => dao::getError(), 'callback' => "zui.Modal.open({id: 'modalBasicInfo'});"));
|
||||
|
||||
@@ -1589,11 +1589,10 @@ class docModel extends model
|
||||
*
|
||||
* @param int $docID
|
||||
* @param object $doc
|
||||
* @param object $oldDoc
|
||||
* @access public
|
||||
* @return array|string|bool
|
||||
*/
|
||||
public function update(int $docID, object $doc, ?object $oldDoc = null): array|string|bool
|
||||
public function update(int $docID, object $doc): array|string|bool
|
||||
{
|
||||
/* 检查必填项。 Check required fields. */
|
||||
$requiredFields = $doc->status == 'draft' ? 'title' : $this->config->doc->edit->requiredFields;
|
||||
@@ -1606,7 +1605,7 @@ class docModel extends model
|
||||
$files = $this->loadModel('file')->saveUpload('doc', $docID);
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$oldDoc = $oldDoc ? $oldDoc : $this->getByID($docID);
|
||||
$oldDoc = $this->getByID($docID);
|
||||
$changes = common::createChanges($oldDoc, $doc);
|
||||
$oldRawContent = isset($oldDoc->rawContent) ? $oldDoc->rawContent : '';
|
||||
$newRawContent = isset($doc->rawContent) ? $doc->rawContent : '';
|
||||
|
||||
Reference in New Issue
Block a user