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.

General Questions

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

SS3 Gridfield "Not Found" Error


Reply

27 Posts   3328 Views

Avatar
Bolixe

20 June 2012 at 1:31am (Last edited: 20 June 2012 1:33am), Community Member, 17 Posts

Hi,

thanks for your answer this are good news! At least I know is my mistake.

I did more or less the same. I create a class Program as a Page and Module as a DataObject, the relation is many_many. But I get the same, I open pages then Program and go to the tab Modules, there I have the table with all the modules I added from the dataobject, but there is noway to link then in a relationship, checkbox that will insert the relation in the table Program_Modules.

******** Program.php *********

class Program extends Page {
   
   
   static $many_many = array(
      'Modules' => 'Module'
   );

   
   function getCMSFields() {
    $fields = parent::getCMSFields();
      
      $dList = DataList::create('Module');
      
      $gridFieldConfig = GridFieldConfig_RelationEditor::create();

      $gridFieldConfig->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchFields('Name');
      
$gridField = new GridField('Modules', 'Modules', $dList, $gridFieldConfig);
      
      $fields->addFieldToTab( 'Root.Content.Modules', $gridField);
      
    return $fields;
   }
   
}

class Program_Controller extends Page_Controller {
   
}

******** Modules.php **********

class Module extends DataObject {
   
   static $db = array(
      'Name' => 'Text'
   );
   
   static $belongs_many_many = array(
      'Programs' => 'Program'
   );
   
   static $summary_fields = array(
'Name' => 'Name'
);
   
}

I will be really gratefull if you Could you explain where I fail and how you do, please. Greetings

Avatar
Bolixe

25 June 2012 at 9:53pm Community Member, 17 Posts

No?? anybody did it??

Any help will be athanked

Avatar
simon_w

26 June 2012 at 9:06am Forum Moderator, 474 Posts

You need to pass the RelationList to the GridField, not just a DataList. So you want

$dList = $this->Modules();

Avatar
shmayek

27 June 2012 at 7:55pm Community Member, 3 Posts

Same problem here on SS3 RC2. UploadField was working for some time, but now when I try to upload image "Not Found" appears. There is also problem with selecting image from cms files, no files are found in "Uploads" directory.

Avatar
priithansen

28 June 2012 at 12:57am Community Member, 25 Posts

Same upload problem continues with fresh RC3 too. Tried on two different servers with php 5.3 and 5.4

Avatar
okotoker

28 June 2012 at 3:32am Community Member, 41 Posts

I haven't been doing exactly the same as Bolixe. I have just been using a simple has_one relation with the GridFieldConfig_RelationEditor. I originally had the not found problem but since moving to beta 3 everything has been fine through rc2.

I don't know if this had anything to do with it but when I was having the problem, I originally upgraded by just moving in the new cms and framework folders. Since my first install to b2 broke, just to make sure I wasn't missing anything I dragged in and replaced everything but mysite and themes folders.

Everything has been good since then.

Avatar
quanto

9 July 2012 at 9:14pm Community Member, 81 Posts

I do have exactly the same problem in SS 3.0.0 stable. I'm using a very simple DataObject code:

<?php
class FotoItem extends DataObject {

   public static $db = array(
'Titel' => 'Varchar'
   );

   public static $has_one = array(
'FotoPagina'=>'FotoPagina',
'Foto'=>'Image'
   );

public function getCMSFields_forPopup() {
$fields = new FieldList();
$fields->push( new UploadField('Foto', 'Foto\'s'));
return $fields;
}
}

Anybody else facing this problem?

Avatar
simon_w

10 July 2012 at 12:38am Forum Moderator, 474 Posts

GridField uses getCMSFields, not getCMSFields_forPopup.