Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » GridField and extensions of DataExtension not 'really' working

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: 525 Views
  • esakrielaart
    Avatar
    Community Member
    53 Posts

    GridField and extensions of DataExtension not 'really' working Link to this post

    Hi,

    I noticed that, when I decorate the Member class by using 'MemberExtension extends DataDecorator' and offcourse putting 'Object::add_extension('Member', 'MemberExtension');' in _config.php, I get the following error when adding new members to the security tab:

    Warning at line 381 of /Users/Maurice/atMarks/elise/www/framework/forms/gridfield/GridFieldDetailForm.php

    Seemed that the following snippet causes the error:

    $message = sprintf(
             _t('GridFieldDetailForm.Saved', 'Saved %s %s'),
             $this->record->singular_name(),
             '<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>'
          );

    When I just put '$message = "some message";' instead, it works just fine. Could it be that this snippet (part of the doSave($data, $form)) needs to be modified to because it might need ->owner inclusions? Is this a known bug? As I couldn't find anything on it.

    Regards,
    Maurice

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: GridField and extensions of DataExtension not 'really' working Link to this post

    The actual error message will probably provide some information on any bug (if there is one) or what needs to be done.

  • martimiz
    Avatar
    Forum Moderator
    1038 Posts

    Re: GridField and extensions of DataExtension not 'really' working Link to this post

    I've seen this happen when using a dutch profile, as a result of a translation in the framwork/lang/nl.yml file:

    GridFieldDetailForm:
    ...
    Saved: '%s %s %s opgeslagen'

    expecting 3 parameters where there are only 2. Looks like this has been fixed in the latest builds.

  • esakrielaart
    Avatar
    Community Member
    53 Posts

    Re: GridField and extensions of DataExtension not 'really' working Link to this post

    Aah, funny thing, I did not thought of checking the language file, but you are right. Thanks! Topic closed.

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