msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

V2.4: getMessages and getChildFolders are empty

Open Pixolantis opened this issue 1 year ago • 0 comments

If I have a folder and want to read the subfolders or messages from it, the output is always empty. But if I count the contents, I get an output:

        $mailFolderId = 'AA......=';
        $mailFolders = $graphServiceClient->users()->byUserId($userId)->mailFolders()->byMailFolderId($mailFolderId)->get()->wait();
        $checkFolderId = $mailFolders->getId(); // Result: Correct Id
        echo 'Count child folder: '.$mailFolders->getChildFolderCount().'<br>'; // Result: 4
        echo 'Count total items: '.$mailFolders->getTotalItemCount().'<br>'; // Result: 10
        //$childFolders = $mailFolders->getChildFolders(); // Result: null
        //$childFolders = $mailFolders->getMessages(); // Result: null

If I make a query for subfolders and messages with the folderId, it works and I also get the corresponding values:

        $subMailFolders = $graphServiceClient->users()->byUserId($userId)->mailFolders()->byMailFolderId($mailFolderId)->childFolders()->get()->wait();
        $messages = $graphServiceClient->users()->byUserId($userId)->mailFolders()->byMailFolderId($mailFolderId)->messages()->get()->wait();

Is this a bug or am I missing something?

Edit: The same with getAttachments()

Pixolantis avatar Apr 12 '24 12:04 Pixolantis