Jump to:

7912 Posts in 1355 Topics by 930 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Bug Reports

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., 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: 37699 Views
  • nakashu
    Avatar
    Community Member
    24 Posts

    Re: Bug Reports Link to this post

    Hi .

    Found a bug in sorting order of dataobject displayed in the CMS - DOM view. (List View)

    Set up:

    • Any DataObjectManager with minimal configuration (one text field).
    • At least 2 dataobjects items added.
    • Enabled - SortableDataObject::add_sortable_class('YourSortedClass'); in _config.php.
    • Default ordering configuration is -- Ascending

    Behaviour:

    • Click any of the items in the list, so popup window will appear.
    • Close it right after. (no save needed)
    • After refresh the items are in reverse order -- Descending

    The order will be ok again after reloading the page in cms, but after opening the popup again, will change as before.

    Revisions // Where to fix.
    This bug was introduced in r419 - in DataObjectManager.php..
    In the current revision r432 is on line '246' - in DataObjectManager.php

    To fix it - REMOVE

    &ctf[{$this->Name()}][dir]={$sort_dir}

    on line 246.

    another notes
    - When trying to define the Sorting order in _config.php with SortableDataObject::set_sort_dir("ASC");
    or DESC .. it wont change anything
    - Not sure if the removed part is important in other parts of the code..

    UncleCheese can you review the code, thanks also for the great work.

    -- to see more cleary changes of the order add SortOrder values from the db to the view

    public function getCMSFields()
       {
          $f = parent::getCMSFields();
          $manager = new DataObjectManager(
             $this, // Controller
             'GalleryImages', // Source name
             'GalleryImage', // Source class
             array(
                'SortOrder' => 'Order',
                'Title' => 'Názov'
             ),
             'getCMSFields_forPopup'         
          );

    $f->addFieldToTab('Root.Content.Main', $manager);
          
          return $f;
       }      

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    Thanks, nakashu,

    I actually added that in a few revs ago because it fixed this problem on several sites. I'll do some more digging and get back to you.

  • Tyler
    Avatar
    Community Member
    2 Posts

    Re: Bug Reports Link to this post

    I "think" there might be an issue with SilverStripe 2.4.1 and the SWFUpload module. I can upload without a hitch using 2.4.0, but in 2.4.1 on numerous sites it just sits at "Uploading...". I tried some of the other recommended fixes where people have previously had this issue but none of them seem to resolve it.

    Here's the SWFUpload debug:

    ---SWFUpload Instance Info---
    Version: 2.2.0 Alpha
    Movie Name: SWFUpload_0
    Settings:
       upload_url: http://mydomain.com/FileDataObjectManager_Controller/handleswfupload
       flash_url: http://mydomain.com/swfupload/javascript/swfupload.swf?swfuploadrnd=837604839
       use_query_string: false
       file_post_name: swfupload_file
       post_params: [object Object]
       file_types:
       file_types_description:
       file_size_limit: 2MB
       file_upload_limit: 20
       file_queue_limit: 20
       debug: true
       prevent_swf_caching: true
       button_placeholder_id: spanButtonPlaceholder
       button_image_url: http://mydomain.com/swfupload/images/upload_button.png
       button_width: 180
       button_height: 24
       button_text: <span class='button'>Upload files</span>
       button_text_style: .button { font-family: Helvetica, Arial, sans-serif; font-size: 12px; }
       button_text_top_padding: 6
       button_text_left_padding: 6
       button_action: -110
       button_disabled: false
       custom_settings: [object Object]
    Event Handlers:
       swfupload_loaded_handler assigned: true
       file_dialog_start_handler assigned: true
       file_queued_handler assigned: true
       file_queue_error_handler assigned: true
       upload_start_handler assigned: true
       upload_progress_handler assigned: true
       upload_error_handler assigned: true
       upload_success_handler assigned: true
       upload_complete_handler assigned: true
       debug_handler assigned: true

    SWF DEBUG: SWFUpload Init Complete
    SWF DEBUG:
    SWF DEBUG: ----- SWF DEBUG OUTPUT ----
    SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 Alpha 2008-10-17
    SWF DEBUG: movieName: SWFUpload_0
    SWF DEBUG: Upload URL: http://mydomain.com/FileDataObjectManager_Controller/handleswfupload
    SWF DEBUG: File Types String: *.*
    SWF DEBUG: Parsed File Types:
    SWF DEBUG: File Types Description: ()
    SWF DEBUG: File Size Limit: 2097152 bytes
    SWF DEBUG: File Upload Limit: 20
    SWF DEBUG: File Queue Limit: 20
    SWF DEBUG: Post Params:
    SWF DEBUG: parentIDName=ParentID
    SWF DEBUG: hasDataObject=0
    SWF DEBUG: OverrideUploadFolder=assets/Uploads/
    SWF DEBUG: controllerID=1
    SWF DEBUG: dataObjectFieldName=
    SWF DEBUG: PHPSESSID=trdp8qqkjg2ek2u883c4jl13g1
    SWF DEBUG: dataObjectClassName=File
    SWF DEBUG: fileFieldName=Files
    SWF DEBUG: fileClassName=File
    SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
    SWF DEBUG:
    SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.*
    SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
    SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
    SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
    SWF DEBUG: StartUpload: First file in queue
    SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
    SWF DEBUG: Global Post Item: parentIDName=ParentID
    SWF DEBUG: Global Post Item: hasDataObject=0
    SWF DEBUG: Global Post Item: OverrideUploadFolder=assets/Uploads/
    SWF DEBUG: Global Post Item: controllerID=1
    SWF DEBUG: Global Post Item: dataObjectFieldName=
    SWF DEBUG: Global Post Item: PHPSESSID=trdp8qqkjg2ek2u883c4jl13g1
    SWF DEBUG: Global Post Item: dataObjectClassName=File
    SWF DEBUG: Global Post Item: fileFieldName=Files
    SWF DEBUG: Global Post Item: fileClassName=File
    SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to http://mydomain.com/FileDataObjectManager_Controller/handleswfupload for File ID: SWFUpload_0_0
    SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0

  • 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;}

    37699 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.