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

FileMigrationHelper does not work with "legacy_filenames: true" #188

Closed
brettt89 opened this issue Nov 6, 2018 · 3 comments
Closed

FileMigrationHelper does not work with "legacy_filenames: true" #188

brettt89 opened this issue Nov 6, 2018 · 3 comments

Comments

@brettt89
Copy link

brettt89 commented Nov 6, 2018

$result = $file->setFromLocalFile(

When running the MigrateFileTask after upgrading from SS3.x to SS4.x, If you have legacy_filenames: true set in your codebase, it will cause the migration to read and write the same file which causes 0 bytes to be written to each file.

This is because the $path and $filename variables being parsed refer to the same file ($path - absolute path of file, $filename - relative path of file) meaning that Flysystem will open up a read handler on $path and then stream its content to $filename which is the same file.

Related PRs

@brettt89
Copy link
Author

brettt89 commented Nov 7, 2018

Managed to resolve this issue locally by changing the Conflict resolution in the Helper to "Keep original" rather than "Overwrite" when legacy_filenames is set to true.

array('conflict' => AssetStore::CONFLICT_OVERWRITE)

@purplespider
Copy link

Thanks, I hit this issue too.

Changing:

array('conflict' => AssetStore::CONFLICT_OVERWRITE)

To:
array('conflict' => AssetStore::CONFLICT_USE_EXISTING)
Seems to fix it, but unsure if this would cause any other side effects.

@maxime-rainville
Copy link
Contributor

We've got a PR for 4.4 at #209

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

No branches or pull requests

4 participants