nyeholt/silverstripe-sharepoint-connector — Issue #1: Empty title for SharepointContentItem if document title is empty in Sharepoint
Author: forsdahl
Created: 2011-10-11 11:26:23+00:00
State: open

Sometimes when a document is stored with an empty title in a Sharepoint repository (for example when creating a document in Word and storing it straight to Sharepoint) the title of the *SharepointContentItem* in Silverstripe will be empty. This results in some strange behaviour (i.e. the item name in lists will be empty, ExternalContentPages can't show the item, etc.). It seems like this is due to the *vti_title* attribute being a newline character in this case (I haven't found the exact reason for this). The solution in this case is simple, just check the trimmed *vti_title* when setting the *SharepointContentItem* title.

In 0.1.0-rc1, SharePointClient.php, change line 314 to:

if (!isset($new['Title']) && isset($new['vti_title']) && trim($new['vti_title']) != '') {
...