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 dialog: The request to tree/parents failed #6627

Closed
distantnative opened this issue Aug 17, 2024 · 3 comments · Fixed by #6642
Closed

Link dialog: The request to tree/parents failed #6627

distantnative opened this issue Aug 17, 2024 · 3 comments · Fixed by #6642
Assignees
Labels
type: regression 🚨 Is a regression between versions
Milestone

Comments

@distantnative
Copy link
Member

Screenshot 2024-08-17 at 7 01 11 PM

The the sandbox…

  1. Go to writer field page
  2. Type in some text, use the link dialog to select the Home page, save
  3. Reload
  4. Select the linked word and open the link dialog
  5. See the error message
@distantnative distantnative added the type: regression 🚨 Is a regression between versions label Aug 17, 2024
@distantnative distantnative added this to the 4.4.0 milestone Aug 17, 2024
@tobimori
Copy link
Contributor

Also happens with link field inside e.g. a structure.

@afbora
Copy link
Member

afbora commented Aug 26, 2024

Summary

When no parents found, response is array, array is empty and we have empty check:
https://github.com/getkirby/kirby/blob/4.4.0-rc.1/src/Panel/Json.php#L78-L80

Possible solutions

  • Put site/tree/parents request in vue component into try/catch block
  • Return a multidimensional array instead of flat array.
return [
  'data' => $parents
];

@distantnative
Copy link
Member Author

@afbora Makes sense, thanks for debugging. I think the 2nd solution sounds like the best way with our API.

@afbora afbora self-assigned this Aug 27, 2024
afbora added a commit that referenced this issue Aug 27, 2024
@afbora afbora linked a pull request Aug 27, 2024 that will close this issue
5 tasks
afbora added a commit that referenced this issue Sep 1, 2024
afbora added a commit that referenced this issue Sep 1, 2024
afbora pushed a commit that referenced this issue Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression 🚨 Is a regression between versions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants