Found a bug which might be to do with the fact that not all properties are updated which correspond to the name when you rename an Folder.
In our example, we're checking for the Start of a Folder has an ID and will update the name which is displayed at the end if it's not up to date.
The Rename is correctly done however the name property & the getServerRelativeUrl provide back the old name of the folder.
// Check if the folder is using an old name
if ($folder->getName() !== $id . ' - ' . $name) {
$folder = $folder->rename($id . ' - ' . $name)->executeQuery();
}
$found = $folder->getServerRelativeUrl();
However running $folder->getName() & $folder->getServerRelativeUrl() after the rename provides the OLD values as these appear to not update.
Found a bug which might be to do with the fact that not all properties are updated which correspond to the name when you rename an Folder.
In our example, we're checking for the Start of a Folder has an ID and will update the name which is displayed at the end if it's not up to date. The Rename is correctly done however the name property & the getServerRelativeUrl provide back the old name of the folder.
However running
$folder->getName()
&$folder->getServerRelativeUrl()
after the rename provides the OLD values as these appear to not update.