getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

[Panel] Conflicting JS and PHP validation on URL field #2270

Closed afbora closed 3 years ago

afbora commented 4 years ago

Describe the bug
We added localhost and ip address support starting with 127 to url validation. Since the JS and PHP validation part are different in the url field, when the localhost address is entered, the JS validation is shown as an error while it passes PHP validation as reported by @GiantCrocodile. So @bastianallgeier's suggestion is to remove instant JS validation.

To Reproduce
Steps to reproduce the behavior:

  1. Go to panel
  2. Edit any page that have URL field
  3. Enter localhost address: http://localhost/kirby/panel/pages/blog+cdwcwd
  4. See red error highlight (JS Validation)
  5. Saving the page is success (PHP Validation)

Expected behavior
JS and PHP validation should use the same rules or JS validation should be removed.

Screenshots
grafik

Related issue: #2130

Kirby Version
3.3.0

GiantCrocodile commented 4 years ago

Maybe the js frontend validation can be triggered by the PHP validation. If PHP validation fails, add the red error highlight. Of course this is no validation prior sending it to the backend but it still helps the user by highlighting the field with invalid data.

Thank you for creating the issue @afbora!

distantnative commented 3 years ago

I would suggest to close this issue - we won't fix it in the current JS and PHP setup. But I think eventually it will get solved indirectly when we switch to do all validation only via the PHP backend.

afbora commented 3 years ago

@distantnative Input still highlighted as red. I guess this issue still continue. Because this is related JS validation. Form already saveable before 3.6. But red highlight confusing.

distantnative commented 3 years ago

@afbora as I wrote, this isn't fixed but we won't solve the JS validation as we plan to switch away from it anyway. That's why Bastian closed it.