您能否告诉我在不使用撰写按钮的 cocrete5 cms 版本 5.8.1.0 中单击编辑按钮(左上菜单)模式后如何发布页面?我无法发布任何页面点击左上角的编辑按钮,编辑它并再次点击编辑按钮。Publish Changes 按钮被禁用,并且有消息:“该字段 Page Thumbnail 是必需的。” 但我可以使用撰写菜单发布(在左上角编辑旁边)。这个问题的原因是什么?它是具体的错误吗?
如果我注释掉检查 publishinh 方法的行,它看起来允许发布。但我仍然无法理解问题的原因以及如何解决它。
class CheckIn extends BackendInterfacePageController
{
protected $viewPath = '/panels/page/check_in';
// we need this extra because this controller gets called by another page
// and that page needs to know how to submit it.
protected $controllerActionPath = '/ccm/system/panels/page/check_in';
public function canAccess()
{
return $this->permissions->canApprovePageVersions() || $this->permissions->canEditPageContents();
}
public function on_start()
{
parent::on_start();
if ($this->page) {
$v = CollectionVersion::get($this->page, "RECENT");
$this->set('publishDate', $v->getPublishDate());
$this->set('publishErrors', $this->checkForPublishing());
}
}
protected function checkForPublishing()
{
$c = $this->page;
// verify this page type has all the items necessary to be approved.
$e = Loader::helper('validation/error');
if ($c->isPageDraft()) {
if (!$c->getPageDraftTargetParentPageID()) {
$e->add(t('You haven\'t chosen where to publish this page.'));
}
}
$pagetype = $c->getPageTypeObject();
// if (is_object($pagetype)) {
// $validator = $pagetype->getPageTypeValidatorObject();
// $e->add($validator->validatePublishDraftRequest($c));
// }
if ($c->isPageDraft() && !$e->has()) {
$targetParentID = $c->getPageDraftTargetParentPageID();
if ($targetParentID) {
$tp = Page::getByID($targetParentID, 'ACTIVE');
$pp = new Permissions($tp);
if (!is_object($tp) || $tp->isError()) {
$e->add(t('Invalid target page.'));
} else {
if (!$pp->canAddSubCollection($pagetype)) {
$e->add(
t(
'You do not have permissions to add a page of this type in the selected location.'
)
);
}
}
}
}
return $e;
}