Jump to:

23471 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » SS3 Gridfield "Not Found" Error

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2 3 4
Go to End
Author Topic: 3235 Views
  • Bolixe
    Avatar
    Community Member
    17 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    Simon is right. I have tried your code quanto, the only fail I get is about 'FotoPagina' because I have not this class.

  • quanto
    Avatar
    Community Member
    81 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    It works in Firefox fine now. Altough in Chrome it still gives 'Not Found', and firebug responses with:

    I can't handle sub-URLs of a Form object.

  • shmayek
    Avatar
    Community Member
    3 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    Tested on Chrome and IE. IE is ok, Chrome gives "Not found".

  • nzblue_fish
    Avatar
    Community Member
    13 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    Hi everyone,

    I've experienced that same issue using Chrome (20.0.1132.47) but have been able to upload a file (Image) successfully using FireFox 2.6.25.

    My model is very simple and I checked as far as possible against the available documentation to make sure it wasn't my error. Will spend a bit more time on this tomorrow, but the problem does seems to have a link to the browser.

    Cheers,
    Innes (NZ)

  • thi3r
    Avatar
    Community Member
    25 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    this should be fixed by:
    https://github.com/silverstripe/sapphire/commit/ba9c3c7b8e7c8f62e319d3cdb5cc4490b7a62f3b

    try and use the latest version on GitHub.

  • nzblue_fish
    Avatar
    Community Member
    13 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    Thanks Thi3r,

    Upload works fine in Chrome now.

    Cheers, Innes

  • quanto
    Avatar
    Community Member
    81 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    It works for me too! Thanks.

  • bb-drummer
    Avatar
    Community Member
    13 Posts

    Re: SS3 Gridfield "Not Found" Error Link to this post

    Hi there...

    I have that same error with a simple combination of a page and some data-rows...
    adding and deleting a record work just fine, but editing a record failed...
    I am using SS-3.0.2...

    class BereicheMitglieder extends DataObject {
       static $db = array(
        'ID'         => 'Int',
          'Gruppe'      => 'Text',
          'Gruppeninfo'   => 'HTMLText',
          'Position1'      => 'Varchar(200)',
          'Person1'      => 'Varchar(200)',
          'Location1'      => 'Varchar(200)',
          'Contact1'      => 'Varchar(200)',
          'Bereiche'      => 'HTMLText'
       );
       
       static $indexes = array(
          'ID' => true,
       );
       
       static $searchable_fields = array(
          'Person1', 'Location1', 'Contact1', 'Bereiche'
    );

    static $summary_fields = array(
          'Gruppe', 'Position1', 'Person1'
       );
       
       static $has_one = array(
        "BereicheMitgliederPage" => "BereicheMitgliederPage",
        "Page" => "Page"
       );
       
       public function getCustomSearchContext() {
    $fields = $this->scaffoldSearchFields(array(
    'restrictFields' => self::$searchable_fields
    ));   
    $filters = array();
    foreach ((array)self::$searchable_fields as $key => $fieldname) {
       $filters[$fieldname]   = new PartialMatchFilter($fieldname);
    }
    return new SearchContext(
    $this->class,
    $fields,
    $filters
    );
    }

    }

    class Bereiche1Mitglieder extends BereicheMitglieder {}
    class Bereiche2Mitglieder extends BereicheMitglieder {}
    class Bereiche3Mitglieder extends BereicheMitglieder {}

    class BereicheMitgliederPage extends Page {

       public static $has_many = array(
          "Bereich1Mitglieders"   => "Bereiche1Mitglieder",
          "Bereich2Mitglieders"   => "Bereiche2Mitglieder",
          "Bereich3Mitglieders"   => "Bereiche3Mitglieder"
    );

       public static $db = array(
          "Bereichtitle1"         => "Varchar(255)",
          "Bereichtitle2"         => "Varchar(255)",
          "Bereichtitle3"         => "Varchar(255)"
    );

    function getCMSFields() {
          $fields = parent::getCMSFields();

          $gridFieldConfig1 = GridFieldConfig::create()->addComponents(
             new GridFieldToolbarHeader(),
             new GridFieldAddNewButton('toolbar-header-right'),
             new GridFieldSortableHeader(),
             new GridFieldDataColumns(),
             new GridFieldPaginator(10),
             new GridFieldEditButton(),
             new GridFieldDeleteAction(),
             new GridFieldDetailForm()
          );
          
          $gridFieldConfig2 = GridFieldConfig::create()->addComponents(
             new GridFieldToolbarHeader(),
             new GridFieldAddNewButton('toolbar-header-right'),
             new GridFieldSortableHeader(),
             new GridFieldDataColumns(),
             new GridFieldPaginator(10),
             new GridFieldEditButton(),
             new GridFieldDeleteAction(),
             new GridFieldDetailForm()
          );
          
          $gridFieldConfig3 = GridFieldConfig::create()->addComponents(
             new GridFieldToolbarHeader(),
             new GridFieldAddNewButton('toolbar-header-right'),
             new GridFieldSortableHeader(),
             new GridFieldDataColumns(),
             new GridFieldPaginator(10),
             new GridFieldEditButton(),
             new GridFieldDeleteAction(),
             new GridFieldDetailForm()
          );
          
          $fields->addFieldToTab('Root.Bereiche', new TextField('Bereichtitle1', 'Überschrift Bereich 1'));
          $itemsInGrid1 = DataList::create('Bereiche1Mitglieder');
          $gridField1 = new GridField("Bereich1Mitglieders", "Bereiche und Mitglieder 1", $this->Bereich1Mitglieders(), $gridFieldConfig1);
          $fields->addFieldToTab('Root.Bereiche', $gridField1);

          $fields->addFieldToTab('Root.Bereiche', new TextField('Bereichtitle2', 'Überschrift Bereich 2'));
          $itemsInGrid2 = DataList::create('Bereiche2Mitglieder');
          $gridField2 = new GridField("Bereich2Mitglieders", "Bereiche und Mitglieder 2", $this->Bereich2Mitglieders(), $gridFieldConfig2);
          $fields->addFieldToTab('Root.Bereiche', $gridField2);

          $fields->addFieldToTab('Root.Bereiche', new TextField('Bereichtitle3', 'Überschrift Bereich 3'));
          $itemsInGrid3 = DataList::create('Bereiche3Mitglieder');
          $gridField3 = new GridField("Bereich3Mitglieders", "Bereiche und Mitglieder 3", $this->Bereich3Mitglieders(), $gridFieldConfig3);
          $fields->addFieldToTab('Root.Bereiche', $gridField3);
          
          return $fields;
       }

    }

    class BereicheMitgliederPage_Controller extends Page_Controller {

       public static $allowed_actions = array (
       );

       public function init() {
          parent::init();
       }
       
       public function ListByNr ( $num = 0 ) {
          if ( $num == 3 ) {
             return Bereiche3Mitglieder::get();
          } else if ( $num == 2 ) {
             return Bereiche2Mitglieder::get();
          } else {
             return Bereiche1Mitglieder::get();
          }
       }
    }

    can somebody please point out what i am doing wrong?

    3235 Views
Page: 1 2 3 4
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.