Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageDataObjectManager

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1549 Views
  • yug
    Avatar
    Community Member
    17 Posts

    Re: ImageDataObjectManager Link to this post

    I changed that but still get this

    [User Error] Couldn't run query: SELECT "BannerImage"."ClassName", "BannerImage"."Created", "BannerImage"."LastEdited", "BannerImage"."Title", "BannerImage"."URL", "BannerImage"."SortOrder", "BannerImage"."BannerImageID", "BannerImage"."ID", CASE WHEN "BannerImage"."ClassName" IS NOT NULL THEN "BannerImage"."ClassName" ELSE 'BannerImage' END AS "RecordClassName", IF(`Page_BannerImages`.`PageID` IS NULL, '0', '1') AS Checked FROM "BannerImage" LEFT JOIN `Page_BannerImages` ON (`BannerImage`.`ID` = `BannerImageID` AND `Page_BannerImages`.`PageID` = '2') GROUP BY "BannerImage"."ClassName", "BannerImage"."Created", "BannerImage"."LastEdited", "BannerImage"."Title", "BannerImage"."URL", "BannerImage"."SortOrder", "BannerImage"."BannerImageID", "BannerImage"."ID", CASE WHEN "BannerImage"."ClassName" IS NOT NULL THEN "BannerImage"."ClassName" ELSE 'BannerImage' END ORDER BY `Page_BannerImages`.SortOrder ASC LIMIT 0, 10 Column 'BannerImageID' in on clause is ambiguous
    GET /admin/

    Line 525 in /data/www/guy-watson-ss.internetrix.net/htdocs/sapphire/core/model/MySQLDatabase.php

  • Ray
    Avatar
    Community Member
    5 Posts

    Re: ImageDataObjectManager Link to this post

    In case anyone's interested in this problem, editing line 63 of the current version of ManyManyDataObjectManager (the construct function) to include the $manyManyTable solves the ambiguity.

    $this->sourceJoin .= " LEFT JOIN \"$manyManyTable\" ON (\"$source\".\"ID\" = \"$manyManyTable\".\"{$sourceField}ID\" AND \"$manyManyTable\".\"{$this->manyManyParentClass}ID\" = '$parentID')";

    1549 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.