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

[Solved] GridFieldConfig_RelationEditor URI Too Large on autofill


Reply


8 Posts   1217 Views

Avatar
Graphicator

Community Member, 62 Posts

14 August 2012 at 11:37am

Edited: 14/08/2012 11:38am

Gridfield is such a new part of the SS 3.0 release, it should have a module forum of its own, IMO.

So I have a method of Relational but as soon as I type in something in the field, I get an immediate notice:

An error occured while fetching data from the server
Please try again later.

And then a growl inside the admin: "Request-URI Too Large"

Book.php:

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

      $config = GridFieldConfig_RelationEditor::create();      
      $f = new GridField('Testimonials', 'Testimonials', $this->Testimonials(), $config);
      $fields->addFieldToTab('Root.Testimonials', $f);   
      
      return $fields;
   }


Testimonial.php Dataobject

      public static $db = array(
         'Title' => 'Varchar(255)',
         'Quote' => 'HTMLText',
         'Tagline' => 'Varchar(255)',
         'SortOrder' => 'Varchar(255)'
      );
      
      public static $has_one = array(
         'Book' => 'Book',
         'Image' => 'Image'
      );

Avatar
Fraser

Community Member, 46 Posts

15 August 2012 at 12:06pm

I'm also experiencing this. Seems to occur very randomly.

Avatar
Graphicator

Community Member, 62 Posts

17 August 2012 at 9:39pm

Just like my other SS3 issues, I just needed to grab this site's stable version, instead of github nightlies of the framework. My problem went away.

Avatar
mats

Community Member, 5 Posts

31 August 2012 at 9:05pm

Even though this is marked "Solved" I still experience the same problem with 3.0.1 stable. The problem seems to be that on line 305 of GridField.js, the whole serialized form plus the attached search string is sent to the server.

data: form.serialize()+'&'+escape(searchField.attr('name'))+'='+escape(searchField.val())

In my case, i have some pretty complex, multitabbed pagetypes that may contain large textblocks. As soon as the culminated contents extend the servers uri-limit all relation search fields cease to work.

For a try, i just removed passing the serialized form from above line and the search field still works! I don't know if this breaks something elsewhere, though. Is anybody able to explain what submitting the whole form data is good for in the first place? I assume that there has to be a reason...

Cheers, mats

Avatar
Verbovikov

Community Member, 1 Post

2 September 2012 at 6:04pm

Doesn't work for me either in 3.0.1 Stable. I've tried mats's fix with removing serialized form sending and it worked. Also auto-complete doesn't work with cyrillic symbols, it does search only latin ones. So I can't now use many to many editor at all as I have to search by name and have russian symbols in there. I miss the old data manager checkboxes style to add many-to-many objects :(

Avatar
joko

Community Member, 6 Posts

25 September 2012 at 1:50am

Edited: 25/09/2012 1:56am

Same problem in 3.0.2 stable. One GridField is working with autocomplete the other isn't. Very strange.
Mats' solution still works but the question remains about unforseen consequences when editing scripts in the framework folder.
Also I pledge for a return of the checkboxes that made working with manymanycomplexfields very intuitive.

I propose to reopen this thread to status [Not solved].

Avatar
micschk

Community Member, 19 Posts

26 September 2012 at 10:10pm

There's a bug report on this issue here: http://open.silverstripe.org/ticket/7828

Avatar
Liam

Community Member, 470 Posts

23 November 2012 at 4:27am

Has anybody run into any problems when making the gridfield.js modification in this post?

I've run into the same issue, so need a fix asap and this looks like it can work.