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

is_url Modifier returns false on entry #2739

Closed
aerni opened this issue Oct 26, 2020 · 4 comments · Fixed by #2759
Closed

is_url Modifier returns false on entry #2739

aerni opened this issue Oct 26, 2020 · 4 comments · Fixed by #2759

Comments

@aerni
Copy link
Contributor

aerni commented Oct 26, 2020

Bug Description

The is_url modifier returns false on a variable that links to an entry. It should return true.

How to Reproduce

  1. Add a link fieldtype to your blueprint
  2. Select an entry
  3. Use the is_url modifier on the variable in your template

Environment

Statamic 3.0.20 Pro
Laravel 8.11.2
PHP 7.4.9
aerni/zipper 1.1.0

@jasonvarga
Copy link
Member

Why would is_url be true on an entry? It's an entry, not a url.

@aerni
Copy link
Contributor Author

aerni commented Oct 28, 2020

Let's say you have a Link Fieldtype with the handle link and select an entry. The data will be saved as link: 'entry::my-entry'. In the view {{ link }} will be augmented to the URL of the entry. And that URL is relative like /my-entry. As of now, the is_url modifier will return false. It should return true though, as it's a URL.

@jasonvarga
Copy link
Member

jasonvarga commented Oct 28, 2020

My mistake, I think I interpreted this as you meaning an "entries" fieldtype, not literally a "link" fieldtype.

@aerni
Copy link
Contributor Author

aerni commented Oct 28, 2020

Sorry for the confusion 😅

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

Successfully merging a pull request may close this issue.

3 participants