kinoli / groupie

Assign users to specific user groups upon registration. Especially useful for front-end signup forms.
Other
3 stars 0 forks source link

Simply not working #8

Closed kevadamson closed 4 years ago

kevadamson commented 4 years ago

I have it installed, the group box ticked, the hidden input in with the correct value, yet when I test, the user isn't assigned to the group. No errors.

I'm using Craft CMS 3.5.7.

kinoli commented 4 years ago

Can you post your form code here? Or at least the relevant parts.

kevadamson commented 4 years ago
<form method="post" accept-charset="UTF-8">

    {{ actionInput('users/save-user') }}
    {{ hiddenInput('groups', '1') }}
    {{ csrfInput() }}

    <fieldset>

        <label>Email *</label><!--
    /--><div class="input lrg">
            <input type="email" name="email" class="type_text" {%- if user is defined %} value="{{ user.email }}"{% endif -%} />
        </div>

    </fieldset><!--

/--><fieldset>

        <label>Choose Password *</label><!--
    /--><div class="input lrg">
            <input type="password" name="password" class="type_text" />
        </div>

    </fieldset>

    <button><span>Start Trial</span></button>

</form>
kevadamson commented 4 years ago

Wondering if it might be conflicting with another plugin? Although wouldn't there be an error?

kinoli commented 4 years ago

Did you install it from the App Store?

Also can you virify by viewing source that the hidden input is in the form as expected?

On Aug 26, 2020, at 2:08 PM, kevadamson notifications@github.com wrote:

{{ actionInput('users/save-user') }} {{ hiddenInput('groups', '1') }} {{ csrfInput() }}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kinoli/groupie/issues/8#issuecomment-681097047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPALQCIMUCPPNK4EOEZULSCVTUJANCNFSM4QMGG67A.

kinoli commented 4 years ago

You could also try it in an array. Like this...

{{ hiddenInput('groups', ‘[1]') }}

On Aug 26, 2020, at 2:12 PM, kevadamson notifications@github.com wrote:

Wondering if it might be conflicting with another plugin? Although wouldn't there be an error?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kinoli/groupie/issues/8#issuecomment-681098823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPALV37KKGSRIULLJEOYLSCVUDJANCNFSM4QMGG67A.

kevadamson commented 4 years ago

Yes and yes.

Also, I have "Allow public registration" ticked on "/admin/settings/users/settings", with default group set to none - would that override it?

kevadamson commented 4 years ago

You could also try it in an array. Like this... {{ hiddenInput('groups', ‘[1]') }} On Aug 26, 2020, at 2:12 PM, kevadamson @.***> wrote: Wondering if it might be conflicting with another plugin? Although wouldn't there be an error? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPALV37KKGSRIULLJEOYLSCVUDJANCNFSM4QMGG67A.

No, still not working ...

kevadamson commented 4 years ago

Yes and yes.

Also, I have "Allow public registration" ticked on "/admin/settings/users/settings", with default group set to none - would that override it?

^ Checked, and that tickbox ticked is needed to register

kinoli commented 4 years ago

Are the other fields updating when you submit the form?

On Aug 26, 2020, at 2:25 PM, kevadamson notifications@github.com wrote:

Yes and yes.

Also, I have "Allow public registration" ticked on "/admin/settings/users/settings", with default group set to none - would that override it?

^ Checked, and that tickbox ticked is needed to register

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kinoli/groupie/issues/8#issuecomment-681104950, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPALTLP4HD7KPNVEGBZYDSCVVTVANCNFSM4QMGG67A.

kinoli commented 4 years ago

It looks like I will need to run some local tests on that version of Craft in order to diagnose the issue. I’ll get back to you as soon as I can.

On Aug 26, 2020, at 2:29 PM, Jesse Knowles jesse@kinoli.com wrote:

Are the other fields updating when you submit the form?

On Aug 26, 2020, at 2:25 PM, kevadamson <notifications@github.com mailto:notifications@github.com> wrote:

Yes and yes.

Also, I have "Allow public registration" ticked on "/admin/settings/users/settings", with default group set to none - would that override it?

^ Checked, and that tickbox ticked is needed to register

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kinoli/groupie/issues/8#issuecomment-681104950, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPALTLP4HD7KPNVEGBZYDSCVVTVANCNFSM4QMGG67A.

kevadamson commented 4 years ago

Yes. The only thing it isn't doing is adding the user to the group.

kevadamson commented 4 years ago

Any update on this?

kinoli commented 4 years ago

I did some testing and noticed the "all" option was causing issues when checked. This might be due to a recent CraftCMS update. I removed the selection for "All" groups. So make sure you go an update the plugin.

Also, You may need to reselect the groups you want to be able to assign users to in your forms. Go to the Groupie settings in the plugins page to do this. I just pushed an update for this, but if you don't have the update yet, you can test it on your end by deselecting the "all" option and selecting the individual groups you want to allow.

kevadamson commented 4 years ago

"All" wasn't checked, so isn't that issue. Are you testing with Commerce Lite installed?

kevadamson commented 4 years ago

Ugh. Working now. Possibly something small I wasn't doing, or perhaps the order I was putting elements in the form?

Anyhow, this is the order of elements in my form that has it working for me:

{{ actionInput('users/save-user') }}
{{ redirectInput('/member/?account=success') }}
{{ csrfInput() }}

<input type="hidden" name="groups[]" value="8">
<input type="hidden" name="groups[]" value="7">

Thanks for your help and patience!

kinoli commented 4 years ago

Glad you got it sorted.