Jump to:

5514 Posts in 1733 Topics by 1219 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin results form sort error

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

Page: 1
Go to End
Author Topic: 1468 Views
  • timwjohn
    Avatar
    Community Member
    98 Posts

    ModelAdmin results form sort error Link to this post

    When attempting to sort the search results table in ModelAdmin I get an undefined index error. Here's the whole thing:

    ERROR
    [Notice] Undefined index: ResultAssembly
    GET /wag/admin/library/Sector/ResultsForm/field/Sector?Name=&amp%3BResultAssembly%5BName%5D=Name&ctf%5BSector%5D%5Bsort%5D=Name

    Line 672 in C:\xampp\htdocs\wag\cms\code\ModelAdmin.php

    Source

    663     *
    664     * @param array $searchCriteria Limit fields by populating the 'ResultsAssembly' key
    665     * @param boolean $selectedOnly Limit by 'ResultsAssempty
    666     */
    667    function getResultColumns($searchCriteria, $selectedOnly = true) {
    668       $model = singleton($this->modelClass);
    669
    670       $summaryFields = $this->columnsAvailable();
    671       
    672       $resultAssembly = $searchCriteria['ResultAssembly'];
    673       if($selectedOnly && $resultAssembly) {
    674          
    675          if(!is_array($resultAssembly)) {
    676             $explodedAssembly = split(' *, *', $resultAssembly);
    677             $resultAssembly = array();
    678             foreach($explodedAssembly as $item) $resultAssembly[$item] = true;
    Trace

    ModelAdmin_CollectionController->getResultColumns(Array)
    Line 697 of ModelAdmin.php
    ModelAdmin_CollectionController->getResultsTable(Array)
    Line 733 of ModelAdmin.php
    ModelAdmin_CollectionController->ResultsForm(SS_HTTPRequest)
    Line 193 of Controller.php
    Controller->handleAction(SS_HTTPRequest)
    Line 354 of ModelAdmin.php
    ModelAdmin_CollectionController->handleActionOrID(SS_HTTPRequest)
    Line 134 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 152 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/library/Sector/ResultsForm/field/Sector)
    Line 127 of main.php

    I've stripped my ModelAdmin right down to the management of a single basic extended DataObject and emptied all custom tables from the database just to eliminate all errors I might have caused, I've even tried switching between beta-2 and rc-1 but it hasn't changed anything.

    What is this ResultAssembly that for some reason doesn't seem to exist? Is anyone else getting this error? How can it be fixed?

  • timwjohn
    Avatar
    Community Member
    98 Posts

    Re: ModelAdmin results form sort error Link to this post

    I know I wrote this at the beginning of the Easter Holidays. Just wondering if those of you that are back online have any ideas of how to fix this?

  • timwjohn
    Avatar
    Community Member
    98 Posts

    Re: ModelAdmin results form sort error Link to this post

    If anybody has any info they can help me with, it would be greatly appreciated. Been going round in circles for ages with this :S

    Thanks!

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: ModelAdmin results form sort error Link to this post

  • timwjohn
    Avatar
    Community Member
    98 Posts

    Re: ModelAdmin results form sort error Link to this post

    Nice one Ingo. And congratulations to you guys on release 2.4. Silverstripe's looking good!

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