Adding labels to members on signup isn't working

  • Summary: When I add a “data-members-label” field to a form, I expect the member to be assigned the submitted label. Instead, the label is added to the dropdown list of available labels in the Members area of the Ghost dashboard, but the member is not actually assigned the label.

  • URL: The site is currently private so I cannot provide a URL at this time.

  • Ghost version: 4.1.2

  • How was Ghost installed and configured? Hosted version.

  • What Node version, database, OS & browser are you using? Whatever the hosted version is using.

  • What errors or information do you see in the console? None.

  • What steps could someone else take to reproduce the issue you’re having?

  1. Add a form to a frontend template and include a “label” field. Something like:
    <form data-members-form='subscribe'>
    <input data-members-label type='checkbox' value='mylabel'>
    <!-- Or: <input data-members-label type='hidden' value='mylabel'> -->
    <input type='email' name='email'>
    <button type='submit'>Subscribe</button>
    </form>
  2. As a logged-out user (i.e. in an incognito window), click the checkbox and add a valid email address. Submit the form.
  3. Click the link in the activation email you receive at the email address from #2.
  4. Go to the members area of the Ghost dashboard (/ghost/#/members) and select the newly-created member.
  5. Observe the “Labels” field. Expected result: the label “mylabel” should be present. Observed result: no labels are present; the label “mylabel” is, however, available as an option in the dropdown.

What do I need to change to get the label to be correctly assigned to the new member?

1 Like
<input data-members-label type='checkbox' value='mylabel'>
<!-- Or: <input data-members-label type='hidden' value='mylabel'> -->

Which one of these are you using? The commented line is what our docs recommend, and should work to add a label - are you saying that doesn’t work?

Not sure about the checkbox usage - haven’t seen that use-case before

I have tried both (and a variety of other solutions, like adding additional attributes, i.e. name=“label” and such) with no success.

Here are some screenshots to help illustrate. After a new member is created, this is what I see:

Note the empty label field. If I click on the field, I see a list of available labels, but none of those labels are applied to the member:

What I expect to see is the label correctly and automatically applied to the member, like so:

1 Like

@mrwilson We have been able to reproduce the bug and will be pushing a fix soon for this.

2 Likes

I have the exact same bug (label created in the dropdown but not applied to the member created). In weeks, haven’t been able to have this feature to work once. Good to hear a fix is coming soon!

Thank you, @rishabhgarg. I look forward to that fix! Let me know if I can help in any way.