银条纹/admin/突然停止工作


Silverstripe /admin/ suddenly stopped working

目前我正在进行一个SilverStripe项目,一切似乎都很顺利。但后来情况发生了变化。。今天早上,我尝试登录,但收到消息说发生了错误。在开发模式下运行时出现以下错误消息:

[用户错误]无法运行查询:SELECT"SiteTree_Live"。"类名","SiteTree_Live"。"已创建","SiteTree_Live"。"上次编辑","SiteTree_Live"。"URLSegment"、"SiteTree_Live"。"标题","SiteTree_Live"。"MenuTitle","SiteTree_Live"。"内容","SiteTree_Live"。"MetaTitle"、"SiteTree_Live"。"MetaDescription","SiteTree_Live"。"MetaKeywords","SiteTree_Live"。"ExtraMeta","SiteTree_Live"。"ShowInMenus"、"SiteTree_Live"。"ShowInSearch","SiteTree_Live"。"域主页","SiteTree_Live"。"ProvideComments","SiteTree_Live"。"排序","SiteTree_Live"。"HasBrokenFile","SiteTree_Live"。"HasBrokenLink","SiteTree_Live"。"状态"、"SiteTree_Live"。"ReportClass","SiteTree_Live"。"CanViewType"、"SiteTree_Live"。"CanEditType","SiteTree_Live"。"待办事项"、"SiteTree_Live"。"版本","SiteTree_Live"。"ParentID",

读取完整错误消息:http://pastebin.com/TrjrEzUn

... WHERE ("SiteTree_Live"."ClassName" IN ('Page','BlogEntry','BlogTree','DienstHolder','DienstPage','FaqHolder','FaqPage','FrontPage','MemberPage','TeamPage','ErrorPage','RedirectorPage','VirtualPage','UserDefinedForm','BlogHolder')) AND (ParentID = ) ORDER BY "Sort" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY "Sort"' at line 1 
GET /Security/login?BackURL=%2Fadmin
Line 525 in /home/admin/domains/stargroup.nl/public_html/sapphire/core/model/MySQLDatabase.php

我在空类名上检查了mysql,有些在找到的地方,但得到了正确的类名。有人对如何克服这个错误并让登录重新开始工作有什么建议吗?

提前Thnx!

发布的查询中的问题是其中一个参数在末尾缺少一个值:

AND (ParentID = ) ORDER BY "Sort"

在不了解silverstripe的情况下,我猜你的一篇文章/帖子不知何故缺少ID或ParentID。

由于SilverStripe IRC频道中的Bollig|DesignCity,错误得以修复。

这一切都与page.php 中的一些代码有关

代码错误

    function Siblings() { 
       $whereStatement = "ParentID = ".$this->ParentID; 
    return DataObject::get("Page", $whereStatement); 
    }

固定代码自我提醒:要时刻注意这样的小错误。。

    function Siblings() { 
       $whereStatement = "ParentID = '".$this->ParentID."'"; 
    return DataObject::get("Page", $whereStatement); 
    }