Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: SPListNameFromUrl throws execption when used for a file stored in root folder

$
0
0
Hey marc,
we're using your Autocomplete function on a website which has been placed inside the root folder of our sitecollection. Inside this function gencontainerId() uses $.fn.SPServices.SPListNameFromUrl which then tries to access currentContext.thisList.length which throws an exception if the file is located inside the rootFolder.

My suggestion would be to change the following lines of code:
} else if(currentContext.thisList.length > 0) {
return currentContext.thisList;
}
---- into ----
} else if(SPServicesContext.thisList !== undefined && SPServicesContext.thisList.length > 0) {
return SPServicesContext.thisList;

}

With this change SPListNameFromUrl returns nothing (which is correct in this case) and nothing changes for the regular case (as far as I can tell).

Regards, Andreas

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>