You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a quirk when renaming SharePoint lists and only the casing changes.
Try the following:
Create a new list "Foo and Bar"
Get the list via Lists.GetByTitle("Foo and Bar") - SUCCESS (as expected)
In the browser, select the list title and rename the list to "Foo And Bar" (note the uppercase A)
Get the list via Lists.GetByTitle("Foo And Bar") - FAILURE (unexpected!)
Get the list via Lists.GetByTitle("Foo and Bar") - SUCCESS (but why??)
(Can also be tested with PnP.PowerShell Get-PnPList).
Expected behavior
I expect step 4 above to work. Deep down below it might be a SharePoint quirk, but maybe PnP could do something about it by making this check case insensitive (as list titles cannot only differ in case):
@jansenbe It seems it is possible to have multiple lists with the same title. Testing with a concurrent list creation approach I was able to create multiple lists with the same title (they differ in the URL though).
Should this be taken into account? Should GetByTitle even return a list? Should there be a GetListByUrlPart? Or is this something to ignore? Through the UI it seems not possible to create such a situation. But programmatically you can create lists with identical titles.
@heinrich-ulbricht : I've just pushed the change, we now use _api/web/lists/getbytitle() just like the batch equivalent of that method already did. Overall I think this will give the best developer experience, changing the output of GetByTitle is not recommended as that would break existing users + the previous implementation also returned the first instance it found or null if none was found.
Category
Steps to reproduce
There seems to be a quirk when renaming SharePoint lists and only the casing changes.
Try the following:
Lists.GetByTitle("Foo and Bar")
- SUCCESS (as expected)Lists.GetByTitle("Foo And Bar")
- FAILURE (unexpected!)Lists.GetByTitle("Foo and Bar")
- SUCCESS (but why??)(Can also be tested with PnP.PowerShell
Get-PnPList
).Expected behavior
I expect step 4 above to work. Deep down below it might be a SharePoint quirk, but maybe PnP could do something about it by making this check case insensitive (as list titles cannot only differ in case):
pnpcore/src/sdk/PnP.Core/Model/SharePoint/Core/Internal/ListCollection.cs
Line 103 in cb19cbc
But this breaks some expression, so implementing this wouldn't be easy?
Not sure about the whole thing. Seems like SharePoint messes something up internally with the title. Feel free to close in this case.
The text was updated successfully, but these errors were encountered: