Email Address Not Mandatory via Admin View

  • Chris Jarvis
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
7 years 2 months ago #94033 by Chris Jarvis
Email Address Not Mandatory via Admin View was created by Chris Jarvis
Hello

I might be missing something but I have noticed that if we need to enter Members in manually through our backend admin panel, the Email address field is not a required field like those defined in Custom fields and it prevents a Joomla User being created if this is missed. Can I get advice on how to make this required please so our staff get prompted when they miss this?

I have gone into the Custom Fields area and defined Address 1 as Required, ZIP Code as Required and see that Email is automatically set to required already.

If I go into subscriptions and click Add New, enter in Username, Password and type an email address it warns me with a red balloon that Address Line 1 and Zip Code are required fields. If I put these in along with email address it then creates my membership and my Joomla User. Perfect!

If I do the same but miss out email address (which is so important) my subscription gets created but no username gets made in the Joomla Core Users and the subscription doesn't have a user connected to it.

Some of our staff are missing to put the email addresses in sometimes when creating manual new subscriptions and this same field (red balloon) would stop that happening.

I'm sure I am seeing this right but apologies if I have missed something.

My email field in Custom fields is set to to required like the others but it doesn't warn me it is blank at the time of entering in Subscriptions

Thanks

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #94055 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Email Address Not Mandatory via Admin View
I don't remember the reason, but for now, we have the email set to optional. If you want to make it required, you would have to edit the code:

1. Open the file administrator/components/com_osmembership/view/subscription/tmpl/default.php

2. Find this block of code;
Code:
if (isset($fields['email'])) { $fields['email']->setAttribute('class', 'validate[custom[email]]'); $fields['email']->required = false; }

3. Change it to:
Code:
if (isset($fields['email'])) { $fields['email']->setAttribute('class', 'validate[required,custom[email]]'); $fields['email']->required = false; }

After that, it should work as expected

Tuan

Please Log in or Create an account to join the conversation.

  • Chris Jarvis
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
7 years 2 months ago #94090 by Chris Jarvis
Replied by Chris Jarvis on topic Email Address Not Mandatory via Admin View
This works great thanks Tuan

Perfect.

How do I do the same for Subscribers email?

I see the default.php file has a similar block but it is different enough for me not to risk it

Will these changes stay after updates of the extension? No problem if not. I can remember to keep adding the changes in once i know them.

Thanks again

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #94108 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Email Address Not Mandatory via Admin View
You are saying that email on subscriber view is not being required? Could you attach a screenshot of that page?

Tuan

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #94612 by Calum
Replied by Calum on topic Email Address Not Mandatory via Admin View

Tuan Pham Ngoc wrote: I don't remember the reason, but for now, we have the email set to optional. If you want to make it required, you would have to edit the code:

Because you might not always have an email for members if membership covers more than just on-line access...

Please Log in or Create an account to join the conversation.