0

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

[用户错误] 无法运行查询:SELECT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created", "SiteTree_Live"."LastEdited", "SiteTree_Live"."URLSegment", "SiteTree_Live"."Title" ,“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”。“HomepageForDomain”,“SiteTree_Live”。“ProvideComments”,“SiteTree_Live”。“排序”,“SiteTree_Live”。“HasBrokenFile”,“SiteTree_Live”。“HasBrokenLink”,“SiteTree_Live”。“状态”,“SiteTree_Live”。“ReportClass”,“SiteTree_Live”。“CanViewType”,“SiteTree_Live”。“CanEditType”,“SiteTree_Live” "."ToDo", "SiteTree_Live"."Version", "SiteTree_Live"."ParentID","SiteTree_Live"."ParentID","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,其中一些找到但得到了正确的类名。任何人都对如何克服此错误并让登录重新开始工作有任何建议?

提前谢谢!

4

2 回答 2

2

发布的查询中的问题是其中一个参数缺少一个值 - 就在最后:

AND (ParentID = ) ORDER BY "Sort"

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

于 2012-03-14T09:46:14.957 回答
1

感谢 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); 
    }
于 2012-04-06T17:49:55.700 回答