Rename a folder from DataObject

Silverstripe Version:
Silverstripe 4.4.3


How do you rename a folder in the new filesystem? There doesn’t seem to be any reliable documentation on the subject for something that seems like it should be simple.

I am trying to set up an object called a “LinkedAssetFolder” that will keep the id of a created folder saved so that images will always be correctly linked even if the client changes the page name.

This worked great in SS3, but in SS4, i am now stuck with the issue that once the folder is created with the ‘new-dataobject’ segment as a name, i can’t rename it from the dataobject, and the versioning stuff in the database seems to be recreating the folder with the wrong name if i delete it to try to make it retry. It is getting immensely frustrating.


This code doesn’t seem to do anything, but there is nothing specifically in the Folder.php object or anywhere in the documentation that suggests how i might be able to do this.

Note: I do not want to have to write React for this, SS3 could do this without any need for javascript and SS4 should really be able to do it too.