I have a large form that I am splitting it up with HeaderTabs for readability.
I am trying to utilize the display=spreadsheet for a few of the multiple template form fields, and found a bug when there is a lack of label tag on the for template call.
Steps to reproduce:
When {{{for template|template_name|multiple|label=Label|display=spreadsheet|embed in field=main[tn]}}} is in the form definition, the form entry page looks normal:
When {{{for template|template_name|multiple|display=spreadsheet|embed in field=main[tn]}}} is in the form definition, the form entry page looks messed up:
My Temporary Fix
I don't know php very well, but I read through and found a spot where the call to the display=spreadsheet in PF_FormPrinter.php was adding a </fieldset> tag regardless if the <fieldset> tag was being called earlier in the FormPrinter. I did a quick edit to see if I could fix it... and it seems I could. I'm not sure if it is the best solution though for this bug due to my lack of experience.
diff --git a/includes/PF_FormPrinter.php b/includes/PF_FormPrinter.php index 88d110fd..3d019950 100644 --- a/includes/PF_FormPrinter.php +++ b/includes/PF_FormPrinter.php @@ -1595,7 +1595,9 @@ END; $multipleTemplateHTML .= $this->spreadsheetHTML( $tif ); // For spreadsheets, this needs // to be specially inserted. - $multipleTemplateHTML .= "</fieldset>\n"; + if ( $tif->getLabel() != null ) { + $multipleTemplateHTML .= "</fieldset>\n"; + } } } elseif ( $tif->getDisplay() == 'calendar' ) { if ( $tif->allInstancesPrinted() ) {