Commit b0420854 authored by Fabianx's avatar Fabianx

Issue #2502263 by hgoto, David_Rothstein, klausi, ckng, rhclayto: Drupal 7.36...

Issue #2502263 by hgoto, David_Rothstein, klausi, ckng, rhclayto: Drupal 7.36 regression: hidden field textarea #default_value is ignored
parent 56940cd4
......@@ -54,8 +54,10 @@ Drupal 7.50, xxxx-xx-xx (development version)
menu link form from 128 to 255 characters.
- Avoid re-scanning of module directory when a filename or a module is missing.
- Fixed ajax handling for tableselect form elements that use checkboxes.
- Fixed that URL generation only worked on port 80 when using domain based
- Fixed that URL generation only works on port 80 when using domain based
language negotation.
- Fixed Drupal 7.36 regression: hidden field textarea #default_value is
ignored.
Drupal 7.44, 2016-06-15
-----------------------
......
......@@ -2571,7 +2571,7 @@ function form_type_select_value($element, $input = FALSE) {
* for this element. Return nothing to use the default.
*/
function form_type_textarea_value($element, $input = FALSE) {
if ($input !== FALSE) {
if ($input !== FALSE && $input !== NULL) {
// This should be a string, but allow other scalars since they might be
// valid input in programmatic form submissions.
return is_scalar($input) ? (string) $input : '';
......
......@@ -2119,3 +2119,36 @@ class HTMLIdTestCase extends DrupalWebTestCase {
$this->assertNoDuplicateIds('There are no duplicate IDs');
}
}
/**
* Tests for form textarea.
*/
class FormTextareaTestCase extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => 'Form textarea',
'description' => 'Tests form textarea related functions.',
'group' => 'Form API',
);
}
/**
* Tests that textarea value is properly set.
*/
public function testValueCallback() {
$element = array();
$form_state = array();
$test_cases = array(
array(NULL, FALSE),
array(NULL, NULL),
array('', array('test')),
array('test', 'test'),
array('123', 123),
);
foreach ($test_cases as $test_case) {
list($expected, $input) = $test_case;
$this->assertIdentical($expected, form_type_textarea_value($element, $input, $form_state));
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment