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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

SS_Report gives error after updating to 2.4.9


Go to End


3 Posts   1622 Views

Avatar
quanto

Community Member, 91 Posts

29 April 2013 at 8:45pm

I have a custom SS_report form. It worked ok in SS 2.4.5, but after the upgrade it hangs after navigate or export to csv and gives the following error:

ERROR [User Error]: Uncaught Exception: ModelAsController->getNestedController(): was not passed a URLSegment value. IN POST /admin/reports//EditForm/field/ReportContent?SecurityID=cce54850b5b4c306e7297843bb193e639c4f1786&ctf[ReportContent][start]=50 Line 87 in /home/***/domains/mydomain.nl/public_html/sapphire/core/control/ModelAsController.php Source ====== 78: } 79: 80: /** 81: * @return ContentController 82: */ 83: public function getNestedController() { 84: $request = $this->request; 85: 86: if(!$URLSegment = $request->param('URLSegment')) { * 87: throw new Exception('ModelAsController->getNestedController(): was not passed a URLSegment value.'); 88: } 89: 90: // Find page by link, regardless of current locale settings 91: Translatable::disable_locale_filter(); 92: $sitetree = DataObject::get_one( 93: 'SiteTree', Trace =====

    ModelAsController->getNestedController() line 64 of ModelAsController.php ModelAsController->handleRequest(SS_HTTPRequest) line 282 of Director.php Director::handleRequest(SS_HTTPRequest,Session) line 125 of Director.php Director::direct(/admin/reports//EditForm/field/ReportContent) line 127 of main.php 

It has something to do with te extra slash after reports (/admin/reports//EditForm/field/ReportContent), cause when I remove it, it will do the export to csv.

My ss_report code:

TipReport.php

class CustomSideReport_Tipcompetitie extends SS_Report {
  function title() { 
    return "Tipcompetitie";
  } 
  function records() {
    return DataObject::get("TipcompetitieZend", "", "Kortebaan");
  }
} 

in _config.php:

SS_Report::register("ReportAdmin", "TipcompetitieReport", 20);

Upgrading to 3.x is currently not an option. Anybody a solution?

Avatar
quanto

Community Member, 91 Posts

8 May 2013 at 11:46pm

"Solved" it by a downgrade to 2.4.7.

Avatar
KiGi

Community Member, 1 Post

4 July 2013 at 12:49pm

Hi quanto,

I had a similar problem and by searching for an answer I stumbled upon your question.

As I don't think it is a good idea to go back in versions (for security and other reasons) to solve a problem , I wanted to let you (and others who will read this) know that this bugfix helped me:

https://github.com/silverstripe/silverstripe-framework/commit/fedb337

By the way I used 2.4.10.

Cheers,
KiGi