CC-3093: SoundCloud preferences do not have email or password as required fields + firefox auto-fills the password field
Fixing bug introduced by last commit...Should test more thoroughly next time... Fixed by creating and adding a custom validator that checks if the field is empty only when some other fields have specific values, in this case, when 'UploadToSoundcloudOption' has a value of '1'.
This commit is contained in:
parent
d3df4b14d2
commit
008278c7ec
1 changed files with 17 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
require_once 'customvalidators/ConditionalNotEmpty.php';
|
||||
|
||||
class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
|
@ -43,12 +44,19 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
|||
$this->addElement('text', 'SoundCloudUser', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'SoundCloud Email',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'autocomplete' => 'off',
|
||||
'value' => Application_Model_Preference::GetSoundCloudUser(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
),
|
||||
|
||||
// By default, 'allowEmpty' is true. This means that our custom
|
||||
// validators are going to be skipped if this field is empty,
|
||||
// which is something we don't want
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array('UploadToSoundcloudOption'=>'1'))
|
||||
)
|
||||
));
|
||||
|
||||
|
@ -56,12 +64,19 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
|||
$this->addElement('password', 'SoundCloudPassword', array(
|
||||
'class' => 'input_text',
|
||||
'label' => 'SoundCloud Password',
|
||||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'autocomplete' => 'off',
|
||||
'value' => Application_Model_Preference::GetSoundCloudPassword(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
),
|
||||
|
||||
// By default, 'allowEmpty' is true. This means that our custom
|
||||
// validators are going to be skipped if this field is empty,
|
||||
// which is something we don't want
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array('UploadToSoundcloudOption'=>'1'))
|
||||
)
|
||||
));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue