Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recently renamed Folders do not update all properties with the new name #310

Open
A-Matt opened this issue Nov 28, 2022 · 0 comments
Open
Labels

Comments

@A-Matt
Copy link

A-Matt commented Nov 28, 2022

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.

@A-Matt A-Matt changed the title Recently renamed Folders do not update all properties with the name Recently renamed Folders do not update all properties with the new name Nov 28, 2022
@vgrem vgrem added the question label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants