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

Crud bug on dynamically disabled rows #2212

Open
mkrecek234 opened this issue Jun 24, 2024 · 1 comment
Open

Crud bug on dynamically disabled rows #2212

mkrecek234 opened this issue Jun 24, 2024 · 1 comment
Labels

Comments

@mkrecek234
Copy link
Contributor

mkrecek234 commented Jun 24, 2024

Crud's ActionsButtons can be set either statically disabled or enabled, or dynamically a) via a passed function via $isDisabled parameter or b) via a dynamically set UserAction->enabled = function ($row) ....

There is however a logical error in

$this->isEnabledFxs[$name] = $isDisabled;

as $this->isEnabledFxs[$name] = $isDisabled; This has to be the negation - or we call $isDisabled better $isEnabled an change references. I am in favor of this, as Atk4\Model always refers to "enabled" and not "disabled".
Let me know, then we can change all $isDisabled to $isEnabled in Atk4\Ui together.

@mvorisek
Copy link
Member

mvorisek commented Jun 26, 2024

Thank you for finding this out.

AFAIR we use disable(d) in some code and enable(d) in another, especially in atk4/data. The unification is not easy as for some usecases, one is more logical.

So for now, let's fix this bug with a test and if you want, feel free to analyse to what vatiant we should unify this, and I can review and tell if I agree or not.

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

No branches or pull requests

2 participants