From: Tyler Anthony Romeo Date: Mon, 6 Aug 2012 21:02:25 +0000 (-0400) Subject: Set form name for HTMLForms in FormAction subclasses. X-Git-Tag: 1.31.0-rc.0~22812^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=36bce64420595d8544bd380395702dec083ca667;p=lhc%2Fweb%2Fwiklou.git Set form name for HTMLForms in FormAction subclasses. Used FormAction::getName() to set the form name for FormAction subclasses. Without a form name, HTMLForm creates weird messages names for certain fields (e.g., in a form with sections, HTMLForm will use the message "$prefix-$key" for the legend, but if no prefix exists, it just becomes "-$key"). Change-Id: I1c19775e44163f4335e30f1d1f73a6e002cb57ec Signed-off-by: Tyler Anthony Romeo --- diff --git a/includes/Action.php b/includes/Action.php index a9891ec772..f4343d16a2 100644 --- a/includes/Action.php +++ b/includes/Action.php @@ -397,7 +397,7 @@ abstract class FormAction extends Action { // Give hooks a chance to alter the form, adding extra fields or text etc wfRunHooks( 'ActionModifyFormFields', array( $this->getName(), &$this->fields, $this->page ) ); - $form = new HTMLForm( $this->fields, $this->getContext() ); + $form = new HTMLForm( $this->fields, $this->getContext(), $this->getName() ); $form->setSubmitCallback( array( $this, 'onSubmit' ) ); // Retain query parameters (uselang etc)