orchidsoftware / orchidsoftware/platform

Listener does not work on a Screen with query loaded class variables

Open
#2,437 0 comments 0 reactions 1 assignee View on GitHub

@tabuna is already working on this.

Since Nov 12, 2022.

Errors
Dominant language
PHP
Stars
4.8k
Forks
662
Avg merge
1d 9h
Merged PRs (30d)
7

Description

Describe the bug
If you have a class variable which is loaded by the query function in the Screen (image for reference) and If you are using this variable in the layout. The Listener's async call will fail...
image

To Reproduce
Steps to reproduce the behavior:

  1. Follow the quickstart to make a post crud (https://orchid.software/en/docs/quickstart-crud/)
  2. Use the $this->post in the layout (e.g. ->canSee($this->post->status == "approved"))
  3. Add a listener to the page (e.g. A Country, State, City selector)

Expected behavior
The Listener should work properly...

Screenshots
image

Desktop:

  • OS: PopOS
  • Browser: Chrome
  • Version [e.g. 22]

Server:

  • Platform Version: ^13.7
  • Laravel Version: ^9.19
  • PHP Version: 8
  • Database: MySQL

I noticed someone had a problem with multiple listeners as well, maybe we need a rework of the Listener Layout...

Can someone point me to an alternate solution I can do for a Country, State, City selector with the Relation input that updates the options for States when selecting country and so on...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.