Skip to content

ErrorException: Trying to access array offset on resource in ***/vendor/justus/flysystem-onedrive/src/OneDriveAdapter.php:258 #23

@WouterDeGeringel

Description

@WouterDeGeringel

Hi there,

First thanks for the great package.

Since updating to v2.0.7 (and laravel 12) I get the following error on:

$disk->get($path)

It seems the OneDriveAdapter readStream method changed causing the error.
It us to return an named array with the resource with the key 'stream".

// OneDriveAdapter->readStream:288
$stream = StreamWrapper::getResource(Utils::streamFor($response->body()));
return compact('stream');

No it returns the resource directly:

// OneDriveAdapter->readStream:288
return StreamWrapper::getResource(Utils::streamFor($response->body()));

This results in an error in OneDriveAdapter->read:258 method

            $object['contents'] = stream_get_contents($object['stream']);

I would love to suggest a pull request, but since I don't know why the change was made, I'm sure how to fix it correctly.
Let me know if I can help.

Regards,
Wouter de Geringel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions