Current Password field hidden on certain forms

Hi there HP Team

We’re having issues with a few of the pages as the Current Password field is set to hidden () but the forms obviously require Current Password to save the changes.

The first being the hp-template–listing-submit-profile-page using form hp-form–user-update-profile. I assume that page/form is being displayed when a Vendor wants to add a new listing after new required fields have been added to the profiles. If that’s the case then great stuff for picking that up.
The second being the hp-template–vendor-register-profile-page using form hp-form–user-update-profile (the same form I see). The page gets displayed after Vendor clicks the Verify Email Address link supplied in the Email Address Verification email and again the Current Password field is set to hidden.
The error message displayed after clicking the Save Changes button: “Current Password” is required.

We’ve used a code snippet from the HP GitHub to set the Current Password as required on the hp-form–user-update, should we modify the code snippet to also set the Current Password field to required for the hp-form–user-update-profile or do you have any idea what might be causing the current Password field to be set to hidden on the hp-form–user-update-profile form?

I tried setting the Current Password field to not required on the form by modifying a code snippet, but it’s not doing the trick. Current Password is still required.

	function( $form ) {
		$form['fields']['categories']['required'] = true;
		$form['fields']['first_name']['required'] = true;
		$form['fields']['last_name']['required'] = true;
		$form['fields']['vendor_address']['required'] = true;
		$form['fields']['vendor_contact_number']['required'] = true;
		$form['fields']['netcash_merchant_no']['required'] = true;		
		$form['fields']['current_password']['required'] = false;

		return $form;

Please share the code snippet you use to make the Current Password field required.

By default, the Current Password is required only if the user changes the password or email in the account settings.

Hi there Yevhen

We were using the code snippet in the previous reply to set the password NOT required, but when searching through the other code snippets we discovered one that set Current Password required so we just deleted the line from the snippet and all is fine now.

Thanks for the feedback and unfortunately there was no way to close this topic/ticket so you didn’t need to work through it. :wink:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.