Skip to content
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

lastModified does not exist on Directory with Laravel 9 #11

Closed
timramseyjr opened this issue Aug 31, 2022 · 6 comments
Closed

lastModified does not exist on Directory with Laravel 9 #11

timramseyjr opened this issue Aug 31, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@timramseyjr
Copy link

  • Operating system : Ubuntu 20.04
  • Laravel version : 9.25.1
  • Package version : 2.0.10
  • Steps to reproduce your issue : Create a folder and refresh the page when using Laravel 9

Unable to retrieve the last_modified for file at location: public/uploads. {"userId":1,"exception":"[object] (League\\Flysystem\\UnableToRetrieveMetadata(code: 0): Unable to retrieve the last_modified for file at location: public/uploads. at /home/examplel/vendor/league/flysystem/src/UnableToRetrieveMetadata.php:49)

The issue is coming from vendor/mafftor/laravel-file-manager/src/LfmItem.php:141 Mafftor\LaravelFileManager\LfmItem::time where lastModified does not exist for the directory

Looks like it is the same thing as UniSharp/laravel-filemanager#1135

@mafftor
Copy link
Owner

mafftor commented Sep 27, 2022

Huge thanks! Will look at this asap!

@mafftor mafftor self-assigned this Sep 27, 2022
@mafftor mafftor added the bug Something isn't working label Sep 27, 2022
@mafftor
Copy link
Owner

mafftor commented Feb 21, 2023

Hi @timramseyjr !
What storage driver do you use?
Is that classic 'local' one?

'local' => [
    'driver' => 'local',
    'root' => storage_path('app'),
    'throw' => false,
],

@mafftor
Copy link
Owner

mafftor commented Feb 21, 2023

@timramseyjr I've published it, could you pull the master branch and test it? Thanks in advance!

@mafftor
Copy link
Owner

mafftor commented Feb 21, 2023

Closing the ticket with no tests, in case the problem appears, please open the new one!
The change will be available in the new release

@mafftor mafftor closed this as completed Feb 21, 2023
@timramseyjr
Copy link
Author

@mafftor I will test it out this week. The issue was with S3 since a last_modified attribute for directories is not returned anymore.

@mafftor
Copy link
Owner

mafftor commented Feb 21, 2023

Great! I've added a try-catch block to return null if the file driver does not support last modified attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants