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

Undefined index: start


Reply

13 Posts   3954 Views

Avatar
xeraa

18 November 2010 at 11:27am Google Summer of Code Hacker, 58 Posts

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

Avatar
cumquat

19 November 2010 at 12:51am (Last edited: 19 November 2010 12:51am), Community Member, 198 Posts

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

Avatar
dacar

22 November 2010 at 11:22am (Last edited: 22 November 2010 11:25am), Community Member, 168 Posts

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

Avatar
xeraa

24 November 2010 at 7:29am Google Summer of Code Hacker, 58 Posts

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()

Avatar
UncleCheese

24 November 2010 at 8:17am 4085 Posts

Thanks. That patch is in.

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