**Silverstripe Version: 4.3.2
I am currently having an issue with UploadField. Current code as follows;
Page.php
use SilverStripe\AssetAdmin\Forms\UploadField;
use SilverStripe\Assets\Image;
use SilverStripe\CMS\Model\SiteTree;
class Page extends SiteTree
{
private static $has_one = [
'PageThumbnail' => Image::class,
];
private static $owns = [
'PageThumbnail'
];
public function getCMSFields()
{
$fields = parent::getCMSFields();
...
$fields->insertAfter(new Tab('NavigationInfo', 'Navigation info'), 'DiscoverLinks');
$fields->addFieldToTab('Root.NavigationInfo', UploadField::create('PageThumbnail', 'Page thumbnail')
->setFolderName('Images/Page-thumbnails')
->setAllowedExtensions(array('jpg','jpeg','png'))
);
return $fields;
}
}
The issue I am having is, if place an image in the field and save/publish, when I go to a different page the field is pre-populated with the previous pages image. If I refresh the page the image is returned to what was saved originally. If I save the page, without refreshing, it will overwrite the page thumbnail with the previous pages imageā¦ I hope this makes sense
This has only started since I upgraded from 4.3.1. Has anyone else had this happening?
Am I missing something with how I have configured my upload field?
Any help would be greatly appreciated.