{"issue":{"state":"open","created_at":"2011-11-29T19:16:09Z","updated_at":"2011-11-29T19:16:09Z","user":{"gravatar_id":"256406243346b9253f8610fb1d1e05f6","id":1215373,"url":"https://api.github.com/users/importer","login":"importer","avatar_url":"https://secure.gravatar.com/avatar/256406243346b9253f8610fb1d1e05f6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":0,"body":"How to generate this bug:\n\nThe format field in tl_form.php is defined as SELECT, using a language reference and helpwizard=>true as follows\n\n```\n\t\t'format' => array\n\t\t(\n\t\t\t'label'                   => &$GLOBALS['TL_LANG']['tl_form']['format'],\n\t\t\t'default'                 => 'raw',\n\t\t\t'exclude'                 => true,\n\t\t\t'inputType'               => 'select',\n\t\t\t'options'                 => array('raw', 'xml', 'csv', 'email'),\n\t\t\t'reference'               => &$GLOBALS['TL_LANG']['tl_form'],\n\t\t\t'eval'                    => array('helpwizard'=>true, 'tl_class'=>'w50')\n\t\t),\n```\n\nThe corresponding language reference is an array (to generate the HELP text in the Helpwizard pop-up). \n\n```\n$GLOBALS['TL_LANG']['tl_form']['raw']          = array('Raw data', 'The form data will be sent as plain text message with each field in a new line.');\n$GLOBALS['TL_LANG']['tl_form']['xml']          = array('XML file', 'The form data will be attached to the e-mail as an XML file.');\n$GLOBALS['TL_LANG']['tl_form']['csv']          = array('CSV file', 'The form data will be attached to the e-mail as a CSV file.');\n$GLOBALS['TL_LANG']['tl_form']['email']        = array('E-mail', 'Ignores all fields except <em>email</em>, <em>subject</em>, <em>message</em> and <em>cc</em> (carbon copy) and sends the form data like it had been sent from a mail client. File uploads are allowed.');\n```\n\nThis all works, EXCEPT, when you add this field to the Child Table, tl_form_field.php in the HEADER section of the child DCA.\n\n```\n$GLOBALS['TL_DCA']['tl_form_field']['list']['sorting']['headerFields'][] = 'format';\n```\n\nThis is the error it generates, because you didn't take into account in the parent-child view, that the header view will need to take awareness of the array() in the language file, instead of just checking for strlen() -- if it's a string.\n\n```\nWarning: strlen() expects parameter 1 to be string, array given in /Library/WebServer/Documents/demo/system/drivers/DC_Table.php on line 3295\n#0 [internal function]: __error(2, 'strlen() expect...', '/Library/WebSer...', 3295, Array)\n#1 /Library/WebServer/Documents/demo/system/drivers/DC_Table.php(3295): strlen(Array)\n#2 /Library/WebServer/Documents/demo/system/drivers/DC_Table.php(345): DC_Table->parentView()\n#3 /Library/WebServer/Documents/demo/system/modules/backend/Backend.php(234): DC_Table->showAll()\n#4 /Library/WebServer/Documents/demo/contao/main.php(101): Backend->getBackendModule('form')\n#5 /Library/WebServer/Documents/demo/contao/main.php(297): Main->run()\n#6 {main}\n```\n\nRelated issues: #1695\n\n--- _Originally created by thyon on July 4th, 2010, at 11:55pm (ID 2247)_","assignee":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","login":"leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":2247,"id":2390615,"labels":[{"name":"backend","color":"e6e6e6","url":"https://api.github.com/repos/contao/import/labels/backend"},{"name":"Defect","color":"bd2c00","url":"https://api.github.com/repos/contao/import/labels/Defect"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"DC_Table.php - Header Fields, references not working","closed_at":null,"html_url":"https://github.com/contao/import/issues/2247","url":"https://api.github.com/repos/contao/import/issues/2247","milestone":{"state":"open","created_at":"2011-11-29T15:29:53Z","due_on":null,"closed_issues":10,"creator":{"gravatar_id":"87d2e5aefadcb310f9155df28c2b3582","id":1192057,"url":"https://api.github.com/users/leofeyer","login":"leofeyer","avatar_url":"https://secure.gravatar.com/avatar/87d2e5aefadcb310f9155df28c2b3582?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":31,"title":"2.9.1","description":"Contao 2.9.1 (maintenance release)","url":"https://api.github.com/repos/contao/import/milestones/31","open_issues":1}},"action":"opened"}