Skip to content

Fixed error when filename is not specified when reading file #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

senasi
Copy link

@senasi senasi commented May 3, 2016

When trying to read file with GridFS\Bucket::openDownloadStream() sub-method openDownloadStreamByFile() is directly accessing $file->filename property which is (according to https://docs.mongodb.org/manual/core/gridfs/#gridfs-collections) optional and is not needed for reading files from GridFS. This PR will fix error notice when this property is not set.

jmikola added a commit to jmikola/mongo-php-library that referenced this pull request Jun 6, 2016
The Bucket's public API remains unchanged. More logic has been moved into the CollectionWrapper and the stream classes have also been renamed.

The StreamWrapper's registration has been changed to allow a configurable protocol (Bucket defaults to "gridfs"). While file paths are generated for readable and writable streams (now in a more robust manner), necessary arguments are passed through context options. We may decide to simplify the path for readable streams down the line, unless the current path is beneficial for debugging.

Closes mongodb#167
@jmikola jmikola closed this in 46864db Jun 7, 2016
@jmikola jmikola added the bug label Jun 7, 2016
@jmikola
Copy link
Member

jmikola commented Jun 7, 2016

Thanks for the PR. This has been fixed with some refactoring in 46864db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants