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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

GridField and extensions of DataExtension not 'really' working


Go to End


4 Posts   1008 Views

Avatar
esakrielaart

Community Member, 59 Posts

13 September 2012 at 2:14am

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

Avatar
(deleted)

Community Member, 473 Posts

13 September 2012 at 8:35am

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

Avatar
martimiz

Forum Moderator, 1391 Posts

13 September 2012 at 10:41pm

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.

Avatar
esakrielaart

Community Member, 59 Posts

13 September 2012 at 10:45pm

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