Php 无法在编辑模式下发布任何页面
您能告诉我在cocrete5 cms版本5.8.1.0中单击编辑按钮(左上菜单)后如何发布页面而不使用撰写按钮吗? 我无法发布任何页面,请单击左上角的“编辑”按钮,编辑它并再次单击“编辑”按钮。 “发布更改”按钮已禁用,并显示以下消息: “需要字段页缩略图。” 但我可以使用“撰写”菜单(左上角“编辑”旁边)发布。 这个问题的原因是什么?这是5个错误吗 如果我在检查publishinh方法时注释掉行,它看起来允许发布。但我仍然无法理解问题的原因以及如何解决它Php 无法在编辑模式下发布任何页面,php,concrete5,concrete5-8.x,Php,Concrete5,Concrete5 8.x,您能告诉我在cocrete5 cms版本5.8.1.0中单击编辑按钮(左上菜单)后如何发布页面而不使用撰写按钮吗? 我无法发布任何页面,请单击左上角的“编辑”按钮,编辑它并再次单击“编辑”按钮。 “发布更改”按钮已禁用,并显示以下消息: “需要字段页缩略图。” 但我可以使用“撰写”菜单(左上角“编辑”旁边)发布。 这个问题的原因是什么?这是5个错误吗 如果我在检查publishinh方法时注释掉行,它看起来允许发布。但我仍然无法理解问题的原因以及如何解决它 class CheckIn exten
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;
}
错误说明了一切?”字段页缩略图是必需的。“您确实添加了缩略图吗?”? 基本上,如果不填写所有必填字段,就无法提交表单
还是您仍然收到错误?我可以解决覆盖文件的问题:
<?php
namespace Application\Attribute\ImageFile;
use Loader;
use Core;
class Controller extends \Concrete\Attribute\ImageFile\Controller
{
public function validateValue()
{
$f = $this->getAttributeValue()->getValue();
if (is_object($f)) {
return true;
}
$e = Core::make('helper/validation/error');
$e->add(t('You must specify a valid file for %s', $this->attributeKey->getAttributeKeyDisplayName()));
return $e;
}
}
据我判断有缩略图。我不能在编辑模式下发布任何页面,但我可以在composer页面上发布。