SharePoint driver: Missing info in cache when directory created #208

Closed
opened 2020-10-15 01:15:25 +00:00 by jamie · 4 comments
jamie commented 2020-10-15 01:15:25 +00:00 (Migrated from git.hazaar.io)

Have a client who is switching to the new driver and reported that when creating a directory, then calling is_writable(), the newly created directory is not writable.

Example:

$dir = $manager->dir('/Invoice');

if(!$dir->exists())
    $dir->create();

if(!$dir->is_writable())
    throw new \Exception('Root directory is not writable!');

Reason appears to be that in Sharepoint::mkdir() it tries to update the info once the create is done, but the API response is possibly incorrect or has changed so the info is not updated/added to the info cache internally. This means that the next call to Sharepoint::is_writable() will not be able to find info and hence will return false.

Have a client who is switching to the new driver and reported that when creating a directory, then calling `is_writable()`, the newly created directory is not writable. Example: ```php $dir = $manager->dir('/Invoice'); if(!$dir->exists()) $dir->create(); if(!$dir->is_writable()) throw new \Exception('Root directory is not writable!'); ``` Reason appears to be that in `Sharepoint::mkdir()` it tries to update the info once the create is done, but the API response is possibly incorrect or has changed so the info is not updated/added to the info cache internally. This means that the next call to `Sharepoint::is_writable()` will not be able to find info and hence will return `false`.
jamie commented 2020-10-15 01:34:44 +00:00 (Migrated from git.hazaar.io)

created merge request !105 to address this issue

created merge request !105 to address this issue
jamie commented 2020-10-15 01:34:44 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !105

mentioned in merge request !105
jamie commented 2020-10-15 01:35:44 +00:00 (Migrated from git.hazaar.io)

Turns out it's actually not creating the directory at all due to an issue with formatting the paths. It is adding an extra '/' in the path which is making Sharepoint reject the request to create the directory. Fixing that issue then everything else worked as expected.

Turns out it's actually not creating the directory at all due to an issue with formatting the paths. It is adding an extra '/' in the path which is making Sharepoint reject the request to create the directory. Fixing that issue then everything else worked as expected.
jamie commented 2020-10-15 01:40:04 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 7d17b72b01db9835bbff13ac20aaf6ada66d63d4

mentioned in commit 7d17b72b01db9835bbff13ac20aaf6ada66d63d4
jamie (Migrated from git.hazaar.io) closed this issue 2020-10-15 01:40:04 +00:00
jamie self-assigned this 2025-09-04 01:15:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#208
No description provided.