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.

Widgets

Discuss SilverStripe Widgets.

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

Updating Sandbox Widget for 2.4


Reply

1143 Views

Avatar
growin

26 February 2011 at 9:44am Community Member, 41 Posts

The creator of Sandbox Widget states on his webpage, "I am now employed. As such, I am no longer able (or allowed) to provide these services." so it looks like I need to figure this out...with some help. I'm new at this. I have a fresh install of SS 2.4 and added the Sandbox Widget (http://www.silverstripe.org/Sandbox-Widget/). Unfortunately it doesn't work. I have it running in Dev Mode to try and figure out where the error is. The error is referring to Restfulservice in saphire/api and I tried to understand the "Handling Errors" here: http://doc.silverstripe.org/sapphire/en/reference/restfulservice . Here's the error as it shows.

[User Notice] RestfulService::connect is deprecated; use RestfulService::request
GET /blog/

Line 100 in /home/*****/public_html/sapphire/api/RestfulService.php
Source

91    
92    protected function constructURL(){
93       return "$this->baseURL" . ($this->queryString ? "?$this->queryString" : "");
94    }
95    
96    /**
97     * @deprecated Use RestfulService::request()
98     */
99    public function connect($subURL = '') {
100       user_error("RestfulService::connect is deprecated; use RestfulService::request", E_USER_NOTICE);
101       return $this->request($subURL)->getBody();
102    }
103    
104    /**
105     * Makes a request to the RESTful server, and return a {@link RestfulService_Response} object for parsing of the result.
106     * @todo Better POST, PUT, DELETE, and HEAD support

Trace

* RestfulService::connect is deprecated; use RestfulService::request
Line 100 of RestfulService.php
* RestfulService->connect()
Line 100 of InstallerWidget.php
* InstallerWidget->GetFormItems()
* call_user_func_array(Array,Array)
Line 693 of Object.php
* Object->__call(GetFormItems,Array)
Line 369 of ViewableData.php
* Widget_Controller->GetFormItems()
Line 369 of ViewableData.php
* ViewableData->obj(GetFormItems)
Line 35 of .cache.widgets_sandbox.InstallerWidget.ss
* include(/tmp/silverstripe-cache-home-*****-public_html/.cache.widgets_sandbox.InstallerWidget.ss)
Line 420 of SSViewer.php
* SSViewer->process(Widget_Controller)
Line 342 of ViewableData.php
* ViewableData->renderWith(Array)
Line 183 of Widget.php
* Widget_Controller->Content()
Line 369 of ViewableData.php
* ViewableData->obj(Content,,,1)
Line 446 of ViewableData.php
* ViewableData->XML_val(Content,,1)
Line 35 of .cache.sapphire.templates.WidgetHolder.ss
* include(/tmp/silverstripe-cache-home-*****-public_html/.cache.sapphire.templates.WidgetHolder.ss)
Line 420 of SSViewer.php
* SSViewer->process(Widget_Controller)
Line 342 of ViewableData.php
* ViewableData->renderWith(WidgetHolder)
Line 193 of Widget.php
* Widget_Controller->WidgetHolder()
Line 369 of ViewableData.php
* ViewableData->obj(WidgetHolder,,,1)
Line 446 of ViewableData.php
* ViewableData->XML_val(WidgetHolder,,1)
Line 10 of .cache.sapphire.templates.WidgetArea.ss
* include(/tmp/silverstripe-cache-home-*****-public_html/.cache.sapphire.templates.WidgetArea.ss)
Line 420 of SSViewer.php
* SSViewer->process(WidgetArea)
Line 342 of ViewableData.php
* ViewableData->renderWith(WidgetArea)
Line 58 of WidgetArea.php
* WidgetArea->forTemplate()
Line 447 of ViewableData.php
* ViewableData->XML_val(SideBar,,1)
Line 320 of .cache.themes.fancypants.templates.Layout.BlogHolder.ss
* include(/tmp/silverstripe-cache-home-*****-public_html/.cache.themes.fancypants.templates.Layout.BlogHolder.ss)
Line 420 of SSViewer.php
* SSViewer->process(BlogHolder_Controller,Zend_Cache_Frontend_Output)
Line 411 of SSViewer.php
* SSViewer->process(BlogHolder_Controller)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 143 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
* ModelAsController->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
* Director::direct(/blog/)
Line 127 of main.php

I'd like to try, as the restfulservice reference mentions, errorCatch. So, am I to add this to the Restfulservice.php in saphire/api or SandboxWidget.php? I'm not sure what, "RestfulService could delgate the error handling to it's descendant class. " means. Any suggestions on helping me to follow this through to getting it working is appreciated.