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

fix: Fix bug with Attachment::path() method #3073

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

Levdbas
Copy link
Member

@Levdbas Levdbas commented Dec 15, 2024

Related:

Solution was provided by @mrfsrf

Issue

When 'Timber\Attachment::path(); is requested, the Path ends up being a mix of a path and a URL.

Solution

If we are working with a URL, the convert the path first to a filesystem path before getting the relative path.

Impact

A method that works again.

Usage Changes

No.

Considerations

Do we need to run the is_url check first since we are probably working with a URL anyway?

Testing

Yes, test added.

…tial URL.

Co-authored-by: Luka Juras <mrfsrf@gmail.com>
@Levdbas Levdbas linked an issue Dec 15, 2024 that may be closed by this pull request
@Levdbas Levdbas changed the title fix: fix Attahement->path() method returning not a filepath but a par… fix: fix Attahement->path() method Dec 15, 2024
@coveralls
Copy link

coveralls commented Dec 15, 2024

Coverage Status

coverage: 88.21% (+0.03%) from 88.182%
when pulling 097d0d1 on 3072-timberattachmentpath-returns-incorrect-value
into 72a013e on 2.x.

@gchtr gchtr changed the title fix: fix Attahement->path() method fix: Fix bug with Attachment::path() method Dec 16, 2024
src/Attachment.php Outdated Show resolved Hide resolved
@Levdbas Levdbas merged commit 5434dde into 2.x Dec 18, 2024
15 of 25 checks passed
@Levdbas Levdbas deleted the 3072-timberattachmentpath-returns-incorrect-value branch December 18, 2024 04:23
This was referenced Dec 18, 2024
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.

Timber\Attachment::path() returns incorrect value
3 participants