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

Link field should display proper errors #6731

Open
linusrogge opened this issue Oct 9, 2024 · 6 comments
Open

Link field should display proper errors #6731

linusrogge opened this issue Oct 9, 2024 · 6 comments

Comments

@linusrogge
Copy link

Description

Creating a type: link field with adjusted options does not return an error when options are invalid. I know this is on the dev to get right, but you might not want to look up the docs every time and find out through trial and error—currently, the whole field is completeley hidden when at least one option is wrong.

The field is shown in the structure preview but not in the opened drawer.

Expected behavior

The field should render an error, displaying the wrong options provided (in my case used - pages instead of - page).

Screenshots

Screenshot 2024-10-09 at 12 55 15 PM Screenshot 2024-10-09 at 12 55 23 PM

To reproduce

  1. Create a blueprint with a type: link field and set the options to something like options: - pages
  2. Look at the Panel and see… nothing
  3. Correct the options and the field should appear

Your setup

Kirby Version

4.4.1

Console output

Screenshot 2024-10-09 at 12 59 51 PM

Your system (please complete the following information)

  • Device: MacBook Pro
  • OS: macOS Sonoma, 15.0.1
  • Browser: Arc
  • Version: 1.63.0 (54427) (Chromium Engine Version 129.0.6668.90)
@linusrogge
Copy link
Author

Also a comment on the link field, although this does not quite belong here—it would be very helpful to customise the specific options further. Like with the page option, to also set a query, filter or exclude certain pages. Just for convenience and better UX for clients.

@afbora
Copy link
Member

afbora commented Oct 16, 2024

There isn't a pages option . It should be page:

link:
  type: link
  options: 
    - page

About query feature, check out: https://feedback.getkirby.com/574

@afbora afbora closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
@linusrogge
Copy link
Author

@afbora thanks for your reply, but please read my actual issues again. I know there isn’t a pages option and that is exactly my point: kirby doesn’t tell me anything about that—it just completely hides the field from the blueprint.

Thanks for the link

@distantnative distantnative reopened this Oct 17, 2024
@afbora
Copy link
Member

afbora commented Oct 17, 2024

Sorry @linusrogge I misread your issue. Let me try to fix it.

@distantnative Do you think we should throw exception about invalid option or ignore invalid options and use fallback options?

@distantnative
Copy link
Member

@afbora i haven't been able to look into it but I am wondering why no error is shown (even if cryptic) but the field just disappears.

@afbora
Copy link
Member

afbora commented Oct 17, 2024

I've looked but didn't understand either why swallow the error? I can fix this issue via throwing an error or ignoring the error from backend side.

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

No branches or pull requests

3 participants