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

Change generateUrl signature #14353

Merged
merged 9 commits into from
Feb 15, 2024
Merged

Change generateUrl signature #14353

merged 9 commits into from
Feb 15, 2024

Conversation

timkelty
Copy link
Contributor

Description

\craft\helpers\Assets::generateUrl took a first argument of BaseFsInterface, however, if you passed an FS, you could end up with the wrong URL if your asset volume had a subpath.

Furthermore, I don't see any need to pass a volume either, since we're required to pass the asset. So, I removed the param entirely. If you want me to scale that back, I can leave it and just change the typing to \craft\models\Volume. I dug around a bit and I've get to see a plugin passing anything but the fs or volume derived from the asset, and I'm not sure why you'd want to.

@brandonkelly brandonkelly merged commit 6f3dc64 into 5.0 Feb 15, 2024
3 checks passed
@brandonkelly brandonkelly deleted the bugfix/subpath-urls branch February 15, 2024 11:58
olivierbon added a commit to craftcms/feed-me that referenced this pull request Apr 16, 2024
`\craft\helpers\Assets::generateUrl` no longer takes an FS as first argument (see [here](craftcms/cms#14353)). Craft 5 only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants