Jump to:

23375 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill

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
Go to End
Author Topic: 1127 Views
  • Graphicator
    Avatar
    Community Member
    62 Posts

    [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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'
          );

  • Fraser
    Avatar
    Community Member
    46 Posts

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

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

  • Graphicator
    Avatar
    Community Member
    62 Posts

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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.

  • mats
    Avatar
    Community Member
    5 Posts

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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

  • Verbovikov
    Avatar
    Community Member
    1 Post

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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

  • joko
    Avatar
    Community Member
    6 Posts

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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].

  • micschk
    Avatar
    Community Member
    19 Posts
  • Liam
    Avatar
    Community Member
    470 Posts

    Re: [Solved] GridFieldConfig_RelationEditor URI Too Large on autofill Link to this post

    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.

    1127 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.