craftcms / cloud-extension-yii2

0 stars 1 forks source link

Fixes path for local dev and other environments #6

Closed kennethormandy closed 1 year ago

kennethormandy commented 1 year ago

Currently, you get an error if you try and use artifactUrl() without manually checking the isCraftCloud variable yourself. In practice, I think we would always want to check that, and allow the $path through otherwise?

kennethormandy commented 1 year ago

Added the other two workarounds I’m using here for completeness. Not necessarily expecting these are the right values to return, but they make the local development environment usable.

timkelty commented 1 year ago

@kennethormandy I think the assetrev-style "return the path on failure" is a little awkward, so I just made sure the URL helpers return null, so you can do a quick ternary in your templates.

Did you have a use-case for calling getBucketName?