sortablefile
sortablefile copied to clipboard
Sortablefile in SiteConfig not updating many_many table
I have add the following to the SiteConfig for a site and the field works - it allows the uploading of multiple files into each db field. Dev/Build created the join table and the records populate accordingly.
private static $many_many = array(
'CardGiftImages' => 'Image',
'CardTwinImages' => 'Image'
);
private static $many_many_extraFields = array(
'CardGiftImages' => array('SortOrder' => 'Int'),
'CardTwinImages' => array('SortOrder' => 'Int')
);
However, attempting to change the order of the items draws a blank, the screen refreshes and to all intents and purposes it has reordered the files, but looking at the DB table or forcing a page refresh shows no change to the items SortOrder in SiteConfig_CardGiftImages for example.
Stuff figured out:
- Seems to only affect SiteConfig
- Number of UploadFields isn't the issue.
- Sort order gets persisted to the DB correctly, but items change position visually upon saving the SiteConfig.
- When reloading the page (eg. settings in the CMS), the files are ordered correctly.