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

** 2.4 Compatibility Patch is in **


Reply


35 Posts   4786 Views

Avatar
Pigeon

Community Member, 243 Posts

16 March 2010 at 6:55am

Yep, sure is.

Thanks Uncy

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

17 March 2010 at 7:48am

I keep getting this error

ERROR [Warning]: Missing argument 3 for DataObjectManager_Item::__construct(), called in C:\Webserver\contentaward2010\sapphire\forms\ComplexTableField.php on line 297 and defined
IN POST /admin/getitem?ID=10&locale=de_DE&ajax=1
Line 582 in C:\Webserver\contentaward2010\dataobject_manager\code\DataObjectManager.php

Source
======
573:    {
574:     return $this->getSetting('confirmDelete');
575:    }
576:    
577:    
578:
579: }
580:
581: class DataObjectManager_Item extends ComplexTableField_Item {
* 582:    function __construct(DataObject $item, DataObjectManager $parent, $start)
583:    {
584:       parent::__construct($item, $parent, $start);
585:    }
586:    
587:    function Link() {
588: return Controller::join_links($this->parent->BaseLink(), '/item/' . $this->item->ID);

Trace
=====
<ul>DataObjectManager_Item->__construct(Absatz,DataObjectManager)
line 297 of ComplexTableField.php

ComplexTableField->Items()
line 367 of ViewableData.php

ViewableData->obj(Items,,,1,)
line 409 of ViewableData.php

ViewableData->cachedCall(Items,)
line 422 of ViewableData.php

ViewableData->hasValue(Items)
line 348 of .cacheC..Webserver.contentaward2010.dataobject_manager.templates.DataObjectManager.ss

include(C:\Dokumente und Einstellungen\philipp\Lokale Einstellungen\Temp\silverstripe-cacheC--Webserver-contentaward2010\.cacheC..Webserver.contentaward2010.dataobject_manager.templates.DataObjectManager.ss)
line 377 of SSViewer.php

SSViewer->process(DataObjectManager)
line 340 of ViewableData.php

ViewableData->renderWith(DataObjectManager)
line 275 of ComplexTableField.php

ComplexTableField->FieldHolder()
line 259 of DataObjectManager.php

DataObjectManager->FieldHolder()
line 367 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 443 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 73 of .cacheC..Webserver.contentaward2010.sapphire.templates.TabSetFieldHolder.ss

include(C:\Dokumente und Einstellungen\philipp\Lokale Einstellungen\Temp\silverstripe-cacheC--Webserver-contentaward2010\.cacheC..Webserver.contentaward2010.sapphire.templates.TabSetFieldHolder.ss)
line 377 of SSViewer.php

SSViewer->process(TabSet)
line 340 of ViewableData.php

ViewableData->renderWith(TabSetFieldHolder)
line 61 of TabSet.php

TabSet->FieldHolder()
line 367 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 443 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 58 of .cacheC..Webserver.contentaward2010.sapphire.templates.TabSetFieldHolder.ss

include(C:\Dokumente und Einstellungen\philipp\Lokale Einstellungen\Temp\silverstripe-cacheC--Webserver-contentaward2010\.cacheC..Webserver.contentaward2010.sapphire.templates.TabSetFieldHolder.ss)
line 377 of SSViewer.php

SSViewer->process(TabSet)
line 340 of ViewableData.php

ViewableData->renderWith(TabSetFieldHolder)
line 61 of TabSet.php

TabSet->FieldHolder()
line 367 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 443 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 77 of .cacheC..Webserver.contentaward2010.sapphire.templates.Includes.Form.ss

include(C:\Dokumente und Einstellungen\philipp\Lokale Einstellungen\Temp\silverstripe-cacheC--Webserver-contentaward2010\.cacheC..Webserver.contentaward2010.sapphire.templates.Includes.Form.ss)
line 377 of SSViewer.php

SSViewer->process(Form)
line 340 of ViewableData.php

ViewableData->renderWith(Array)
line 1077 of Form.php

Form->forTemplate()
line 1104 of Form.php

Form->formHtmlContent()
line 376 of LeftAndMain.php

LeftAndMain->getitem(SS_HTTPRequest)
line 193 of Controller.php

Controller->handleAction(SS_HTTPRequest)
line 134 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 283 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.php

Director::direct(/admin/getitem)
line 127 of main.php

</ul>

As a quick hack I did the following:

Index: DataObjectManager.php
===================================================================
--- DataObjectManager.php   (revision 377)
+++ DataObjectManager.php   (working copy)
@@ -579,9 +579,11 @@
}

class DataObjectManager_Item extends ComplexTableField_Item {
-   function __construct(DataObject $item, DataObjectManager $parent, $start)
+   //function __construct(DataObject $item, DataObjectManager $parent, $start)
+   function __construct(DataObject $item, DataObjectManager $parent)
   {
-      parent::__construct($item, $parent, $start);
+      //parent::__construct($item, $parent, $start);
+      parent::__construct($item, $parent);
   }
   
   function Link() {
Index: FileDataObjectManager.php
===================================================================
--- FileDataObjectManager.php   (revision 377)
+++ FileDataObjectManager.php   (working copy)
@@ -645,9 +645,11 @@
}

class FileDataObjectManager_Item extends DataObjectManager_Item {
-   function __construct(DataObject $item, ComplexTableField $parent, $start)
+   //function __construct(DataObject $item, ComplexTableField $parent, $start)
+   function __construct(DataObject $item, ComplexTableField $parent)
   {
-      parent::__construct($item, $parent, $start);
+      //parent::__construct($item, $parent, $start);
+      parent::__construct($item, $parent);
   }
   
   public function IsFile()

dataobject_manager: 377
sapphire: 101143
browser: firefox 3.6

Avatar
UncleCheese

Forum Moderator, 4096 Posts

17 March 2010 at 8:17am

Interesting that no one else, including myself has gotten that error. Is there a specific set of actions that causes it?

Avatar
xeraa

Google Summer of Code Hacker, 58 Posts

17 March 2010 at 10:27am

Are you using SilverStripe trunk or beta1? I'm on trunk.

An API change led to a change in /sapphire/forms/ComplexTableField.php in revision 98543 from

$output->push(Object::create($this->itemClass,$item, $this));


to

$output->push(new $this->itemClass($item, $this));

I guess my change is not very sensible, only a quick fix which seems to work (at least for me).

Avatar
UncleCheese

Forum Moderator, 4096 Posts

17 March 2010 at 10:51am

Bugger.

Avatar
UncleCheese

Forum Moderator, 4096 Posts

17 March 2010 at 10:53am

Actually, now that I look at it, that change is meaningless. Those two lines of code do exactly the same thing.

Avatar
hotcode

Community Member, 13 Posts

18 March 2010 at 8:41pm

Thx for the update .... I've tested in 2.4 beta and all works except the pretty photo (javascript doesn't load so opens photo on its own in window).

I just updated another 'test site' to 2.4 beta 2 and am now getting the same error that xeraa has reported above ... so I'll do the hack around until someone comes up with a better solution :)

I get the error when adding a image gallery page, and also when I did the upgrade (from beta to beta 2) with image gallery pages already created. Could rebuild the db fine, just couldn't access the admin area due to error. The gallery page showed but when clicking on an image it wouldn't go past the loading bar.

Hope this helps :) Let me know if you need more info.

Avatar
hotcode

Community Member, 13 Posts

18 March 2010 at 9:26pm

Also found another bit further in the code ....

ERROR [Warning]: Missing argument 3 for ImageDataObjectManager_Item::__construct(), called in D:\VertrigoServ\www\ss24\sapphire\forms\ComplexTableField.php on line 297 and defined
IN POST /ss24/admin/getitem?ID=21&ajax=1
Line 58 in D:\VertrigoServ\www\ss24\dataobject_manager\code\ImageDataObjectManager.php

Source
======
49:       return floor(($this->SliderPercentage()/100) * self::$sliderWidth) - (.17 *
$this->SliderPercentage()); // handle is 16px wide
50:    }
51:       
52:
53: }
54:
55: class ImageDataObjectManager_Item extends FileDataObjectManager_Item
56: {
57:
* 58:    function __construct(DataObject $item, ComplexTableField $parent, $start)
59:    {
60:       parent::__construct($item, $parent, $start);
61:    }
62:
63:    public function FileIcon()
64:    {