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

CardDeck default UserAction not working #1844

Closed
mkrecek234 opened this issue Aug 31, 2022 · 3 comments · Fixed by #1845
Closed

CardDeck default UserAction not working #1844

mkrecek234 opened this issue Aug 31, 2022 · 3 comments · Fixed by #1845
Labels

Comments

@mkrecek234
Copy link
Contributor

Steps to reproduce:

  • add default CardDeck to any view
  • set any model to CardDeck
  • Press default UserAction 'Add' and enter entity

Error:

  • Expected entity, but instance is a model
    if ($action->getModel()->isLoaded() && $card = $this->findCard($action->getModel())) {

and here

if (in_array($model->getId(), array_map($mapResults, $model->export([$model->idField])), true)) {

Replacing $action->getModel() by $action->getEntity() also won't fix it...

@mvorisek
Copy link
Member

Yes, $action->getModel()->isLoaded() is definitely wrong.

In the past I put a lot of efford into atk4/data#932 but there are some issues & limitations with phpstan itself although I filed and fixed many bugs there... Before releasing v4.0, it would be great if I can manage to run such static analysis at least one locally.

@mvorisek
Copy link
Member

Is there any demo in demos/? Or can any existing demo be adjusted with one, two lines to reproduce there?

@mvorisek mvorisek changed the title cardDeck default UserAction not working CardDeck default UserAction not working Aug 31, 2022
@mkrecek234
Copy link
Contributor Author

mkrecek234 commented Aug 31, 2022

See https://github.com/atk4/ui/tree/bug/card_deck_add_action
However since save is deactivated in demo, error not triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants