Fix unable to preview revisions (#1687)

* Fix unable to preview revisions

* Improve revision preview fix

Co-authored-by: joyqi <joyqi@users.noreply.github.com>

---------

Co-authored-by: joyqi <joyqi@users.noreply.github.com>
This commit is contained in:
LibXZR
2024-01-06 23:33:11 +08:00
committed by GitHub
parent a9fa990124
commit 68026e0fbc

View File

@@ -1661,7 +1661,12 @@ EOF;
}
/** 设置归档类型 */
[$this->archiveType] = explode('_', $this->type);
if ($this->parameter->preview && $this->type === 'revision') {
$parent = ContentsFrom::allocWithAlias($this->parent, ['cid' => $this->parent]);
$this->archiveType = $parent->type;
} else {
[$this->archiveType] = explode('_', $this->type);
}
/** 设置归档缩略名 */
$this->archiveSlug = ('post' == $this->archiveType || 'attachment' == $this->archiveType)