Jump to:

7912 Posts in 1355 Topics by 930 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Go to End
Author Topic: 54234 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    There should be a deDE3.php file in the lang folder, no? Not sure what happened to the en_US file. I've replaced it. Do an SVN update.

  • Johnny
    Avatar
    Community Member
    34 Posts

    Re: Preview: DataObjectManager module Link to this post

    Hi UncleCheeze!!

    The error happens at line 513:

    509: $file->write();
    511: $obj->$idxfield = $file->ID;
    512: //die ("lowerbound");
    513: $ownerID = $_POST['parentIDName'];
    514: die ("upperbound");
    515: $obj->$ownerID = $_POST['controllerID'];

    It's wierd no?

    Hope this will help!

    JP

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    Are you sure you're on the latest SVN of dataobject_manager and swfupload? That looks like a bug I resolved a while ago.

  • Johnny
    Avatar
    Community Member
    34 Posts

    Re: Preview: DataObjectManager module Link to this post

    Hi UncleCheeze!

    I updated from SVN and it still happening!

    JP

  • pali
    Avatar
    Community Member
    33 Posts

    Re: Preview: DataObjectManager module Link to this post

    hello,

    im new in SS and i feel stupid in fundamental things

    i added many images into a page, i know how to call them in page.ss. But i need to show only 1st image on pagelist.ss ->

    im using

    <% if ImageAtts %>
    <% control ImageAtts %>
    <% if First %>
    <a href="$Link" title="$Title">$ImageAtt.SetWidth(176)</a>
    <% end_if %>
    <% end_control %>
    <% end_if %>


    .. and it outputs only empty anchor.

    if i remove <% if First %> all images are shown.

    thanky

    pali

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: Preview: DataObjectManager module Link to this post

    @pali:
    your posted code should work, tried it in 2.3.1
    could you post your corresponding page class/controller code?

    @UncleCheese:
    found another inconsistency, not sure though wheter this one is dataobjectmanger - related:
    whenever i duplicate a page in cms, all related dataobjects (managed in a dataobjectmanager) are gone for the duplicate.
    haven't checked using a regular ctf, so might be a silverstripe-problem?

    btw: considerable feedback (317 posts by now!) to this module makes clear it requires it's own forum. should i send an email to silverstripe-staff?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Preview: DataObjectManager module Link to this post

    @Shellmax

    If you are using a has_one relationship on the attached DataObject it will have one column called MyPageTypeID which corresponds to the page they are attached to. When you duplicate that page, the new page has a different ID and so those dataObjects will not be associated with that page. You would need to use a has_many or belongs_many_many relationship and a ManyManyDataObjectManager to have DataObjects visible on more than one page.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    @Johnny -- That's really strange. Can you change the die statement to print_r($_POST) and make sure that "parentIDName" is in the array? Also check line 263 of FileDataObjectManager and make sure that it is being added as a post param

    'parentIDName' => $this->getParentIdName( $this->getParentClass(), $this->sourceClass() ),

    If it is, try echoing out $this->getParentIdName( $this->getParentClass(), $this->sourceClass() ) somewhere below the addPostParams() function and see if you can get anything to come out.

    As a reminder, you need to set up your data model like so:

    FileHolder -> has_many -> FileObjects -> has_one -> File

    And of course, FileObject->has_one FileHolder.

    It's all in the FDOM docs.

    @pali -- Please post your code. It doesn't seem right that $ImageAtts is the control and ImageAtt is the object in that loop.

    @schellmax - Please forward your request to Silverstripe. I've asked them and they turned me down. I think I need a bigger army.

    54234 Views
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.