Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Bug Reports


Go to End
Reply


297 Posts   50973 Views

Avatar
zenmonkey

Community Member, 528 Posts

24 July 2010 at 3:55am

I'm having a problem with the Image DOM, It appears to have issues accessing Directory with a dash (-) in the name. The files in that dir are accessible from the rest of the CMS, and if I move them to directory without a dash in the name they're accessible from the DOM.

Firebug reports a 500 error when I try to access those directories. Its not a critical bug (I can just change the naming structure), but I thought you should know. I'm running on MAMP right now, I haven't rolled the site out to my full testing server yet.

Avatar
UncleCheese

Forum Moderator, 4093 Posts

24 July 2010 at 4:26am

What do you mean by "accessible from DOM?"

Avatar
zenmonkey

Community Member, 528 Posts

24 July 2010 at 4:43am

I'm setting Internal Server Errors when trying to access certain folders through the "Import from an existing folder" dropdown in a nested ImageDataObjectManager. However if I try to add images from those folders through the standard HTMLEditor field, I have no problems

Avatar
Iain_vdw

Community Member, 22 Posts

29 July 2010 at 1:41am

Edited: 29/07/2010 1:48am

We think we've found a bug in SWFUpload/FileDataObjectManager. It's caused when a user without full admin rights tries to upload a file in "Files & Images" through an SWFUploadField.

Setup:
SS 2.4.0 / 2.4.1
Latest DOM and SWFUpload modules
User with access to CMSMain, AssetAdmin, Reports and Comments. No full admin rights.

Bug:
When selecting a file in the SWFUpload field and pressing "Upload", the request freezes on processing. With the use of the SWFUpload debug mode and some var_dump()'ing we've located that the permission check in FileDataObjectManager.php line 587 checks for the wrong permission. The checked for permission is

if(!Permission::check("CMSAccess_CMSMain"))


when it should be

if(!Permission::check("CMS_ACCESS_CMSMain"))

We've tried and tested this and it works normally now without errors.

Users with full admin rights automatically pass the Permission::check() function because they've got access to all parts of the CMS and the function automatically adds the "ADMIN" role to check for.

Avatar
UncleCheese

Forum Moderator, 4093 Posts

29 July 2010 at 2:11am

Yup, that was fixed in the last rev. Thanks.

Avatar
nakashu

Community Member, 24 Posts

19 August 2010 at 1:30am

Edited: 19/08/2010 1:46am

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

Avatar
UncleCheese

Forum Moderator, 4093 Posts

19 August 2010 at 1:44am

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.

Avatar
Tyler

Community Member, 2 Posts

19 August 2010 at 4:13am

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

Go to Top