sortablefile icon indicating copy to clipboard operation
sortablefile copied to clipboard

Sortablefile in SiteConfig not updating many_many table

Open mspacemedia opened this issue 7 years ago • 1 comments

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.

mspacemedia avatar Feb 21 '18 18:02 mspacemedia

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.

bummzack avatar Feb 21 '18 20:02 bummzack