Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Bug Reports

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Go to End
Author Topic: 47868 Views
  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: Bug Reports Link to this post

    Hey Uncle Cheese,

    I thought Id try running; /dev/tests/all to check my code and received this error;

    Fatal error: Class 'Image_Uploader' not found in swfupload/code/SWFUploadFileIFrameField.php on line 47

    Im guessing the class was left in from an earlier build. Can the class 'SWFUploadFileIFrameField_Uploader' be removed?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    SWFUpload has been sunsetted in favor of the Uploadify Module

    http://www.leftandmain.com/silverstripe-modules/2010/08/26/uploadify/

    ----------
    Silverstripe tips, tutorials, screencasts, and more: http://www.leftandmain.com

  • dendeffe
    Avatar
    Community Member
    135 Posts

    Re: Bug Reports Link to this post

    SilverStripe 2.4.1
    DOM and SWFUpload 485(?) from your SVN today.

    The sortable image checkbox (Dutch) label doesn't fit in the box: http://skitch.com/dendeffe/dii2d/silverstripe-cms-pagina-inhoud

    I always have to change .sort-control in dataobject_manager.css when I update.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    Could you post the change you have to make?

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • dendeffe
    Avatar
    Community Member
    135 Posts

    Re: Bug Reports Link to this post

    I change line 92 of dataobject_manager.css to this:

    .sort-control {width:100%;float:left;padding:8px 0 0 5px;}

    instead of this:

    .sort-control {width:16em;float:left;padding:8px 0 0 5px;}

  • Nimblor
    Avatar
    Community Member
    1 Post

    Re: Bug Reports Link to this post

    Found an issue with ManyManyDataObjectManager - when working with objects that have no sortable properties, and no default sort behaviour defined, the popup window fails to open (shows a query error)

    The query error is due to DataObjectManager adding an ORDER BY clause to the query, when it has no field to sort by. Because the 'sort' value is coming from $_REQUEST, even though it was NULL on the server, its received as an empty string, and so checking for a sort condition with isset() returns true.

    The fix seems quite simple, change line 104 of ManyManyDataObjectManager.php from:

    elseif(isset($_REQUEST['ctf'][$this->Name()]['sort'])){


    To:

    elseif(!empty($_REQUEST['ctf'][$this->Name()]['sort'])){

    The same issue may occur with the other types (ie HasManyDataObjectManager), I haven't looked into them since we aren't using them for anything ;)

  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Re: Bug Reports Link to this post

    I'm trying to use a variable that has many Images for a page banner using the code below:

    BannerFile.php:

    class BannerFile extends Image {

       static $has_one = array (
          'Pages' => 'Page'
       );

    }

    Page.php

       public static $has_many = array(
          'BannerFiles' => 'BannerFile'
       );

       function getCMSFields() {
          $fields = parent::getCMSFields();

    $fields->addFieldToTab("Root.Content.Thumbnail", new FileUploadField('Thumbnail', 'Thumbnail'));

          $fields->addFieldToTab("Root.Content.Banners", new MultipleImageUploadField('BannerFiles','Upload several banner files'));
    //...
       return $fields;
       }

    On seemingly random pages I get the error:

    [User Error] Couldn't run query: SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "BannerFile"."PagesID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" LEFT JOIN "BannerFile" ON "BannerFile"."ID" = "File"."ID" WHERE ("File"."ClassName" IN ('Image','BannerFile','Image_Cached')) AND (ID = '22') ORDER BY SortOrder ASC LIMIT 1 Column 'ID' in where clause is ambiguous
    GET /site/3d-scanners/accessories/?flush=1

    Line 536 in G:\localhost\site\sapphire\core\model\MySQLDatabase.php

    The images are shown correctly for the test pages where I assigned images too. On random other pages (both with and without banner images added) I get the above error.

    If I change Image to File in the BannerFile class the error disappears.

    BannerFile.php:

    class BannerFile extends File {

       static $has_one = array (
          'Pages' => 'Page'
       );

    }

    Can I only use the File class and not the Image class with the new Uploadify Class? Or is there a bug somewhere else?

  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: Bug Reports Link to this post

    I think you might need your relation to be;

    public static $has_many = array(
    'BannerFile' => 'BannerFile'
    );

    47868 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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.