Jump to content

Field of class FieldtypeURL not working?


Sylvio
 Share

Recommended Posts

I have a template with a field called website, the field is of class FieldtypeURL.

Now its weird, I expect if I add a page and fill the website field with a non-valid URL I would get

an error or notification of some sort, but it doesn't? It just saves the page!

Any explanation?

Cheers

Sylvio

Link to comment
Share on other sites

You are right, that would make sense. :) See the latest commit, it contains updates to the FieldtypeURL/InputfieldURL so that it reports errors as you would expect. Note that it still saves the page, but it will now at least tell you about the error. I'll be adding an additional javascript validation option for Inputfields once we enable required fields.

Thanks,

Ryan

Link to comment
Share on other sites

Ryan,

Weird, I can't seem to get it working, what am I doing wrong? I'm not getting notified if I fill in

a non-valid url, for instance: htp:/rosebrand

I updated my wire directory with the latest commit.

Regards

Sylvio

Link to comment
Share on other sites

The specs on what is considered a valid URL are apparently very broad. I've had the same experience in being a little surprised at what PHP's filter_var URL filtering allows. But apparently it is based on a defined  ISO (?) standard. If you put some extended ASCII or accented characters in there, you'll see the URL filtering get involved. We may want to implement a more defined URL filter specific to just http/s (perhaps as a configuration option for this fieldtype). Also double check that you have relative urls turned off in the field's configuration, as it may help in this particular case (though not yet at a computer to test).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...