Skip to content

Change generateUrl signature#14353

Merged
brandonkelly merged 9 commits into5.0from
bugfix/subpath-urls
Feb 15, 2024
Merged

Change generateUrl signature#14353
brandonkelly merged 9 commits into5.0from
bugfix/subpath-urls

Conversation

@timkelty
Copy link
Copy Markdown
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.

Comment thread src/helpers/Assets.php
@brandonkelly brandonkelly merged commit 6f3dc64 into 5.0 Feb 15, 2024
@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