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

[Bug] checklist_dependency possible bug #525

Closed
skatsaounis opened this issue Mar 8, 2017 · 9 comments
Closed

[Bug] checklist_dependency possible bug #525

skatsaounis opened this issue Mar 8, 2017 · 9 comments

Comments

@skatsaounis
Copy link
Contributor

Hello Cristian,

I am opening the issue here because I think it has to do with checklist_dependency field. The problem occurs when creating a user, while using PermissionManager.

Description:
Admin wants to create a user and give him specific role. On submitting the request, if for any reason form validation fails, there is a problem with checklist_dependency. Ticked role stays ticked but its permissions get unticked. Furthermore, if admin fixes the error (e.g. password matching) without change ticks on roles, the user is created in database without any role assigned to him. (Role was ticked from previous form submission though).

The exact same scenario works perfect when updating an existing user.

Once again thank you for your time and effort on this awesome package.

Kind regards,
Stamatis

@eddilou
Copy link

eddilou commented Jun 7, 2017

The question is still open #712

@lloy0076
Copy link
Contributor

lloy0076 commented Jun 7, 2017

Successfully reproduced as described in #525 (comment).

This isn't the same issue as #712.

@tabacitu
Copy link
Member

tabacitu commented Sep 4, 2017

Hi @skatsaounis ,

I see #712 has been closed so I'll close this one too. Please correct me if I'm wrong.

Cheers!

@tabacitu tabacitu closed this as completed Sep 4, 2017
@tabacitu
Copy link
Member

tabacitu commented Sep 4, 2017

Oups, I see it's not the same issue. Opening it again :-)

@skatsaounis , thanks a lot for the clear bug report.
@lloy0076 thanks a lot for confirming you can reproduce the issue, it helps a lot.

@mariusconstantin2503 do you think you can work on a PR to fix this?

@tabacitu tabacitu reopened this Sep 4, 2017
@tabacitu tabacitu changed the title checklist_dependency possible bug [3.6][Bug] checklist_dependency possible bug Aug 17, 2019
@ziming
Copy link
Contributor

ziming commented Nov 17, 2019

I see it is labelled a bug in 3.6. Does this mean this is not a bug in 4.0?

@pxpm
Copy link
Contributor

pxpm commented Nov 17, 2019

@ziming not sure, just got here from your notification :)

Please if you test it leave here the your findings. 👍

Best,
Pedro

@awgklist
Copy link

In regards to v3.6 and the checklist_dependency.blade.php template:

From what I can tell,
The primary & secondary fields which are setup via javascript are not re-populated when the page re-loads (i.e. when the page fails validation). It's only on a javascript change event that then those hidden fields are setup. I'm guessing that the "old" fields aren't rendered to the page given the check for isset($field['value']) that surrounds them.

For a workaround you can manually re-trigger the change event on the primary checkboxes to re-populate those hidden fields. Either on page load -or- prior to submission.

e.g.
$('.checklist_dependency .primary_list:checked').trigger('change');

Hopefully that makes sense and helps.

@tabacitu tabacitu removed the Bug label Jul 25, 2020
@tabacitu tabacitu changed the title [3.6][Bug] checklist_dependency possible bug [Bug] checklist_dependency possible bug Oct 15, 2020
@pxpm
Copy link
Contributor

pxpm commented Oct 28, 2020

I think this might be related with #1816 that is going to be addressed in 4.2, with PR #3054

So I am postponing this to 4.2, so that when we merge that fix we hopefully fix this issue too.

@tabacitu
Copy link
Member

Hey guys. I've just merged Pedro's #4057 which fixes this in 4.2. Sorry it took us so long to do it.

Cheers!

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

No branches or pull requests

7 participants