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: 47901 Views
  • wmk
    Avatar
    Community Member
    45 Posts

    Re: Bug Reports Link to this post

    ok. left my comment there.

    using translation sometimes makes me think about the advantages of esperanto... ;)

  • theAlien
    Avatar
    Community Member
    131 Posts

    Re: Bug Reports Link to this post

    Two minor template-bugs:
    1) Setting $myDOM->setPermissions('add') won't remove either the delete or the edit buttons. This can easily be solved by adding <% if Can(delete) %> ... <% end_if %> around line 76 and <% if Can(edit) %> ... <% end_if %> aroundline 75 of DataObjectManager.ss. I guess it's the same for the other templates (but haven't tested it)

    2) Not really a bug, more of an improvement: Removing the add-button with setPermissions will leave a huge blank space above the DOM. This can either be solved by putting the title of the DOM instead of the button with <% else %> or by removing the whole block by adding <% if HasFilter || Can(add) %> ... <% end_if %> around lines 3-14 of DOM.ss (and again I guess it's the same for the other DOM-templates)

    BTW, did you deliberately choose not to support the $myDOM->setPermissions('show') option?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    setPermissions() takes an array, not a string.

    $myDom->setPermissions(array('add','edit','upload'));

  • theAlien
    Avatar
    Community Member
    131 Posts

    Re: Bug Reports Link to this post

    Sorry,
    That's a typo in the post...
    The issue still exists

    (literal quote from my code, which doesn't hide the delete-button (though disables it's functionality): $accountobject->setPermissions(array('edit')); // turn add- and delete-buttons off)

  • silk78
    Avatar
    Community Member
    8 Posts

    Re: Bug Reports Link to this post

    Hi!

    When trying to import existing images to an image gallery I get the following error:

    Error: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'ImageGalleryImage'
    At line 551 in /srv/rsv-kanu_neu/sapphire/core/Object.php

    I am using the latest releases of Silverstripe and Image Gallery.

    Best Regards,
    Christian

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    I'm not sure why that happens. Looks like an SS bug to me. For now I've put in a temporary fix that you should get if you update your svn.

  • silk78
    Avatar
    Community Member
    8 Posts

    Re: Bug Reports Link to this post

    Unfortunatly, the problem remains.
    The error message also is still the same.

    I found an entry in apache error-log, though:

    File does not exist: /srv/rsv-kanu_neu/bulk_uploader

    I reinstalled Silverstripe and also image gallery.
    A side effect: When the error occurs, the first selected image gets destroyed.

    Thank's a lot for your effort!
    Christian

  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Re: Bug Reports Link to this post

    Okay I'm running Safari 4.03 OS X 10.5.8 and SS 2.2.3 on MAMP

    And the Delete Record Icon isn't showing up.

    Here is the Code for my DataObject

    class UserApplication extends DataObject {
       static $db = array(
             'FirstName' => 'Text',
             'LastName' => 'Text',
             'Email' => 'Text',
             'CompanyName' => 'Text',
             'CompanyType' => "Text",
             'CompanyURL' => 'Text',
             'CompanyPhone' => 'Text',
             'Address' => 'Text',
             'Address2' => 'Text',
             'City' => 'Text',
             'Country' => 'Text',
             'TaxIDNumber' => 'Text',
             'Distributor' => 'Text',
             'SalesRep' => 'Text',
             'Description' => 'Text',
             'ApprovedMember' => 'Boolean',
             'Password' => 'Text'
       );
       
       static $has_one = array(
          'RegistrationPage' => 'RegistrationPage',      
       );
       
       public function getCMSFields_forPopup()
       {
          $companyTypeList = array(
             'Retail' => 'Retail',
             'Online' => 'Online',
             'Distributor' => 'Distributor',
             'Press' => 'Press'
          );
          
          return new FieldSet (
             new CheckBoxField('ApprovedMember', 'Approved Member'),
             new TextField('FirstName', 'First Name'),
             new TextField('LastName','Last Name'),
             new EmailField('Email'),
             new TextField('CompanyName','Company Name'),
             new DropdownField('CompanyType','Company Type',$companyTypeList),
             new TextField('CompanyURL','Company Website'),
             new TextField('CompanyPhone','CompanyPhone'),
             new TextField('Address','Address'),
             new TextField('Address2','Address Line 2'),
             new TextField('City','City'),
             new TextField('Country','Country'),
             new TextField('TaxIDNumber','TaxIDNumber'),
             new TextField('Distributor','Distributor'),
             new TextField('SalesRep','Sales Rep'),
             new TextareaField('Description','Description'),
             new ConfirmedPasswordField('Password')
          );
          
       }

    }

    And from the Pagetype

    class RegistrationPage extends Page
    {
       static $has_many = array (
          'UserApplications' => 'UserApplication'
       );
       
       public function getCMSFields()
       {
          $f = parent::getCMSFields();
          $applicationManager = new DataObjectManager(
             $this,
             'UserApplications',
             'UserApplication',
             array('FirstName' => 'FirstName','LastName' => 'LastName','Email' => 'Email','CompanyName' => 'CompanyName','CompanyType' => "CompanyType",'CompanyURL' => 'CompanyURL','CompanyPhone' => 'CompanyPhone','Address' => 'Address','Address2' => 'Address2','City' => 'City','Country' => 'Country','TaxIDNumber' => 'TaxIDNumber','Distributor' => 'Distributor','SalesRep' => 'SalesRep','Description' => 'Description','ApprovedMember' => 'ApprovedMember','Password' => 'Password'),
             'getCMSFields_forPopup'
          );
          
          $f->addFieldToTab("Root.Content.Applications", $applicationManager);
          
          $f->removeFieldFromTab('Root.Content.Main', 'Content');
          $f->removeFieldFromTab('Root.Content.Main', 'LifestyleText');
          
          return $f;
       }
       
    }

    class RegistrationPage_Controller extends Page_Controller
    {
       
    }

    But in the CMS the delete button doesn't show up in any of my DataObjectManagers, though it does in the FileDataObjectManager

    Attachments are disabled so I Can't post a screen Cap

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