开发者

Silverstripe Editors can not edit own DataObjects

My problem is that editors can't edit or create certain DataObjects I created for page I built. Some are editable and some aren't. And if I switch language, it's a multi-language site, then the Input fields don't even appear.

Examples: I have a class for links to display a linklist

  • German -> Editors can edit and create
  • Englisch -> No fields in popup

Other class that manages Downloads

  • German -> Show: yes, edit & create: no
  • Englisch -> No fields in popup

Could anybody hint me to where the problem may be?

EDIT2: File with code attached in comments

Edit: Here's my translate Function:

public function getCMSFieldTranslated(FieldSet $fieldset, array $transFields) {
    // If a translation exists, exchange them with
    // original/translation field pairs
   开发者_运维技巧 $translation = $this->getTranslation(Translatable::default_locale());
    if($translation && $this->Locale != Translatable::default_locale()) {
        $transformation = new Translatable_Transformation($translation);

        foreach($transFields as $fieldName => $field) {
            $fieldset->replaceField($fieldName, $transformation->transformFormField($field));
        }
    }
}


You have to specify the fields in the popup to be translated. Look at the translation documentation on this. http://doc.silverstripe.org/sapphire/en/topics/translation#translating-custom-properties

In the example, it use the getCMSFields function, but use the same strategy for the getPopupFields().

If that don't help you, post your model and controller.

Have a good day.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜