BUGFIX: Fixed issue caused by HTMLEditorField selecting the column FieldName

BUGFIX: Fixed issue caused by ManyManyList remove all removing the File table from the FROM statement when removing all records from SiteTree_ImageTracking for a given page
This commit is contained in:
Ed 2012-04-24 21:13:24 -03:00 committed by Kirk Mayo
parent 2ef72b374c
commit 0cec9a6f33
2 changed files with 6 additions and 2 deletions

View File

@ -45,7 +45,8 @@ class FileSubsites extends DataExtension {
*/
function augmentSQL(SQLQuery &$query) {
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)
if(!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0])) {
//@TODO I don't think excluding if SiteTree_ImageTracking is a good idea however because of the SS 3.0 api and ManyManyList::removeAll() changing the from table after this function is called there isn't much of a choice
if(!array_key_exists('SiteTree_ImageTracking', $query->from) && (!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0]))) {
/*if($context = DataObject::context_obj()) $subsiteID = (int) $context->SubsiteID;
else */$subsiteID = (int) Subsite::currentSubsiteID();

View File

@ -41,7 +41,10 @@ class SiteTreeSubsites extends DataExtension {
),
'belongs_many_many' => array(
'BackCrossSubsiteLinkTracking' => 'SiteTree'
)
),
'many_many_extraFields' => array(
"CrossSubsiteLinkTracking" => array("FieldName" => "Varchar")
)
);
}