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   3445 Views

Avatar
Bolixe

Community Member, 17 Posts

20 June 2012 at 1:31am

Edited: 20/06/2012 1:33am

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

Community Member, 17 Posts

25 June 2012 at 9:53pm

No?? anybody did it??

Any help will be athanked

Avatar
simon_w

Forum Moderator, 474 Posts

26 June 2012 at 9:06am

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

$dList = $this->Modules();

Avatar
shmayek

Community Member, 3 Posts

27 June 2012 at 7:55pm

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

Community Member, 25 Posts

28 June 2012 at 12:57am

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

Avatar
okotoker

Community Member, 41 Posts

28 June 2012 at 3:32am

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

Community Member, 81 Posts

9 July 2012 at 9:14pm

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

Forum Moderator, 474 Posts

10 July 2012 at 12:38am

GridField uses getCMSFields, not getCMSFields_forPopup.