Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2008 at 09:17 UTC
Updated:
3 Mar 2008 at 09:39 UTC
Error on installation, on the page "Congratulations, Drupal has been successfully installed.":
notice: Array to string conversion in includes/form.inc on line 670.
Relevant code in form.inc:
// We only check for trimmed string length being zero. 0 might be
// a possible value with some field types, such as radio buttons, so
// empty() is not usable here.
if ($elements['#required'] && strlen(trim($elements['#value'])) == 0) { // #670
form_error($elements, $t('!name field is required.', array('!name' => $elements['#title'])));
}
Presumably the installer sets a field #value to an array, which does not seem to be ruled out by the API. form.inc should check the type here.
Comments
Comment #1
cburschkaNote: Drupal 6 has thorough type-checking there; this is a regression.
Comment #2
cburschkaOn examination of the CVS logs, it appears that this regression was already introduced to Drupal 6, but rolled back.
Issue was #117748: Trim required fields on validate. Note that this was the last commit on the file prior to D6 branching. I guess this went unnoticed, so the rollback was not completed in HEAD.
The issue actually is still open for Drupal 7 and (RTBsomething), so this is a duplicate.
Comment #3
vladimir.dolgopolov commentedLook here:
http://drupal.org/node/117748#comment-724841
Comment #4
vladimir.dolgopolov commentedoops, cross-post
Comment #5
cburschkaCross post.