From 485a0e8cc63072e3731bdbab9392270c27a3278c Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Thu, 24 Nov 2011 15:45:39 -0500 Subject: [PATCH] CC-3093: SoundCloud preferences do not have email or password as required fields + firefox auto-fills the password field I just realized this: 1. Enable "Enable Soundcloud Upload" in preference and fill in the username+password, click save 2. Go back to preference, change unrelated setting like "Station Name", click save 3. Now since soundcloud password field is empty (expected, as we don't want others to see how many digits are there), the save failed This commit is to fix this. Created another custom validator for the password field, which does the same thing as ConditionalNotEmpty validator but allow password field to be empty when the username/email field wasn't changed. --- .../forms/SoundcloudPreferences.php | 3 ++- .../customvalidators/PasswordNotEmpty.php | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 airtime_mvc/application/forms/customvalidators/PasswordNotEmpty.php diff --git a/airtime_mvc/application/forms/SoundcloudPreferences.php b/airtime_mvc/application/forms/SoundcloudPreferences.php index 8fe460c15..e948ba4f4 100644 --- a/airtime_mvc/application/forms/SoundcloudPreferences.php +++ b/airtime_mvc/application/forms/SoundcloudPreferences.php @@ -1,5 +1,6 @@ false, 'validators' => array( - new ConditionalNotEmpty(array('UploadToSoundcloudOption'=>'1')) + new PasswordNotEmpty(array('UploadToSoundcloudOption'=>'1')) ) )); diff --git a/airtime_mvc/application/forms/customvalidators/PasswordNotEmpty.php b/airtime_mvc/application/forms/customvalidators/PasswordNotEmpty.php new file mode 100644 index 000000000..11e62b933 --- /dev/null +++ b/airtime_mvc/application/forms/customvalidators/PasswordNotEmpty.php @@ -0,0 +1,18 @@ +