Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Undefined index: start

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3651 Views
  • xeraa
    Avatar
    Google Summer of Code Hacker
    58 Posts

    Re: Undefined index: start Link to this post

    As far as I can tell it's working fine on your demo site.

    I'll try to find some time and do some more debugging over the week-end...

  • cumquat
    Avatar
    Community Member
    189 Posts

    Re: Undefined index: start Link to this post

    Not wishing to hijack the thread but i have a problem and a question, one where do you get Dom r513 as the silverstripe site only shows r511 and two the problem i'm getting is replicated on your demo site. When you create a gallery page and then add images to it the first one is ok but if you go back to the second and try to add a caption you get the error below i was using the gallery page that the time i called 'this one'.

    [Notice] Trying to get property of non-object
    GET /admin/cms/EditForm/field/GalleryItems/item/97/edit?SecurityID=1241950032&ctf[GalleryItems][start]=0&ctf[GalleryItems][per_page]=10&ctf[GalleryItems][showall]=0&ctf[GalleryItems][sort]=SortOrder&ctf[GalleryItems][sort_dir]=&ctf[GalleryItems][search]=&ctf[GalleryItems][filter]=AlbumID_14&ctf[GalleryItems][view]=grid&ctf[GalleryItems][imagesize]=100

    Line 140 in /home/carlinow/public_html/_sites/dataobjectmanager/image_gallery/code/ImageGalleryManager.php

    Source

    131    {
    132       $childData = parent::getChildDataObj();
    133       $childData->ImageGalleryPageID = $this->controllerID;
    134       return $childData;
    135    }
    136    
    137    public function getPreviewFieldFor($fileObject, $size = 150)
    138    {
    139       if($fileObject instanceof Image) {
    140          $URL = $fileObject->SetHeight($size)->URL;
    141          return new LiteralField("icon",
    142             "<div class='current-image'>
    143                <div id='preview-image'>
    144                   <img src='$URL' alt='' class='preview' />
    145                   <div class='ajax-loader'><img src='dataobject_manager/images/ajax-loader.gif' />". _t('ImageGalleryManager.ROTATING','Rotating')."...</div>
    146                </div>
    Trace

    ImageGalleryManager->getPreviewFieldFor(ImageGalleryImage,200)
    Line 110 of ImageDataObjectManager.php
    ImageDataObjectManager_ItemRequest->DetailForm()
    Line 369 of ViewableData.php
    ViewableData->obj(DetailForm,,1)
    Line 32 of .cache.dataobject_manager.templates.DataObjectManager_popup.ss
    include(/tmp/silverstripe-cache-home-carlinow-public_html-_sites-dataobjectmanager/.cache.dataobject_manager.templates.DataObjectManager_popup.ss)
    Line 420 of SSViewer.php
    SSViewer->process(ImageDataObjectManager_ItemRequest)
    Line 342 of ViewableData.php
    ViewableData->renderWith(DataObjectManager_popup)
    Line 924 of DataObjectManager.php
    DataObjectManager_ItemRequest->edit(SS_HTTPRequest)
    Line 137 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 155 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 155 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 155 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 281 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session)
    Line 124 of Director.php
    Director::direct(/admin/cms/EditForm/field/GalleryItems/item/97/edit)
    Line 127 of main.php

    Cheers

    Mick

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: Undefined index: start Link to this post

    Hi, i think it has to do with the wrong request URI. In my case it is:

    http://www.bliblablubb.de/silver/admin/assets/EditForm/field/Files/item/56?SecurityID=817067710/edit?ctf[Files][start]=1&ctf[Files][per_page]=10&ctf[Files][showall]=0&ctf[Files][sort]=SortOrder&ctf[Files][sort_dir]=&ctf[Files][search]=&ctf[Files][filter]=&ctf[Files][view]=1%29

    I think the the right place for securityID should be: ?SecurityID=817067710

    http://www.bliblablubb.de/silver/admin/assets/EditForm/field/Files/item/56/edit?SecurityID=817067710/ctf[Files][start]=1&ctf[Files][per_page]=10&ctf[Files][showall]=0&ctf[Files][sort]=SortOrder&ctf[Files][sort_dir]=&ctf[Files][search]=&ctf[Files][filter]=&ctf[Files][view]=1%29

  • xeraa
    Avatar
    Google Summer of Code Hacker
    58 Posts

    Re: Undefined index: start Link to this post

    Using the latest trunk it's now working fine for me.

    But the next / previous links are broken, here's a patch:

    Index: DataObjectManager.php
    ===================================================================
    --- DataObjectManager.php   (revision 516)
    +++ DataObjectManager.php   (working copy)
    @@ -1024,14 +1024,14 @@
          
       function NextRecordLink()
       {
    - if(!$this->itemList || $this->currentIndex == sizeof($this->itemList)-1) return false;
    - return Controller::join_links($this->ctf->BaseLink() , 'item' . $this->getNextID().'edit',"?".$this->ctf->getQueryString());      
    +      if(!$this->itemList || $this->currentIndex == sizeof($this->itemList)-1) return false;
    +      return Controller::join_links($this->ctf->BaseLink() , 'item/' . $this->getNextID().'/edit',"?".$this->ctf->getQueryString());
       }
       
       function PrevRecordLink()
       {
    - if(!$this->itemList || $this->currentIndex == 0) return false;
    - return Controller::join_links($this->ctf->BaseLink() , 'item' . $this->getPrevID().'edit',"?".$this->ctf->getQueryString());
    +      if(!$this->itemList || $this->currentIndex == 0) return false;
    +      return Controller::join_links($this->ctf->BaseLink() , 'item/' . $this->getPrevID().'/edit',"?".$this->ctf->getQueryString());
       }
       
       function HasPagination()

  • UncleCheese
    Avatar
    4085 Posts

    Re: Undefined index: start Link to this post

    Thanks. That patch is in.

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

    3651 Views
Page: 1 2
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.