thats4shaw

I don’t think it works otherwise but I could be wrong.

thats4shaw

And it will be RedirectorPage::class in your allowed_children array.

👍 (1)
thats4shaw

Doesn’t look like you are using any namespaces.

thats4shaw

@mmativ is referring to this issue https://github.com/silverstripe/silverstripe-asset-admin/issues/919

Show 1 attachment(s)
lerni

In an Element with a has_one Image the Image "cache-hangs" in the CMS, specifically in UploadField. I've added a LiteralField with a Thumbnail and the path beside the UploadField to make the problem better visible. The LiteralField and also the Thumbnail thingy in the Elemental-GF are correct but on the second Element 'BBB' the Thumbnail in UploadField is wrong. It even shows the wrong Image if I click on the edit-eye in the UploadField. Check the short Screencast below.

class ElementTextImage extends BaseElement {
  private static $has_one = [
    'Image' => Image::class
  ];
  private static $field_labels = [
    'Image' => 'Bild',
  ];

  private static $owns = [
    'Image'
  ];

  private static $table_name = 'ElementTextImage';

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

    if ($uploadField = $fields->dataFieldByName('Image')) {
      $uploadField->allowedExtensions = array('jpg', 'png');
      $uploadField->setFolderName('TextImageElement');
      $uploadField->setDescription('min. 1400x1800px');
    }
    $fields->addFieldToTab('Root', LiteralField::create('image-debug', $this->Image()->CMSThumbnail() .'<br>'. $this->Image()->URL), 'Image');

    return $fields;
  }
}

https://user-images.githubusercontent.com/472115/53904500-8d0f7680-4046-11e9-8203-2507665dfcf3.gif|wrong-image

silverstripe/admin                         1.3.2 
silverstripe/asset-admin                   1.3.2 
silverstripe/assets                        1.3.2 
silverstripe/cms                           4.3.2 
silverstripe/config                        1.0.12
silverstripe/framework                     4.3.2 
silverstripe/graphql                       3.0.2 
silverstripe/recipe-cms                    4.3.2 
silverstripe/versioned                     1.3.2 
silverstripe/versioned-admin               1.1.2 
Hide attachment content
👍 (1)
thats4shaw

I don’t think it was elemental related. I suspect it might be related to the upload field so might be worth writing up a issue if you have reproducible steps @Nick

thats4shaw

I had a client reporting something similar yesterday but kind of blew it off.

thats4shaw

I don’t like rollercoasters so a pretty boring one sounds great.

👌 (2)