developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #858: 858-1.diff

File 858-1.diff, 1.6 KB (added by bballizlife, 9 years ago)
  • lib/jelix/plugins/tpl/html/function.formsubmit.php

     
    33* @package    jelix
    44* @subpackage jtpl_plugin
    55* @author     Laurent Jouanneau
    6 * @copyright  2007 Laurent Jouanneau
     6* @contributor Loic Mathaud
     7* @copyright  2007 Laurent Jouanneau, 2009 Loic Mathaud
    78* @link        http://www.jelix.org
    89* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
    910*/
     
    2223            $ctrl = $tpl->_privateVars['__submit'];
    2324        }else{
    2425            $ctrls = $tpl->_privateVars['__form']->getSubmits();
     26            if (count($ctrls) == 0) {
     27                throw new jException('jelix~formserr.unknow.control',
     28                array('submit', $tpl->_privateVars['__form']->getSelector(),$tpl->_templateName));
     29            }
    2530            reset($ctrls);
    2631            $ctrlname = key($ctrls);
    2732            $ctrl = current($ctrls);
    2833        }
    2934    }else{
    3035        $ctrls = $tpl->_privateVars['__form']->getSubmits();
     36        if (count($ctrls) == 0) {
     37            throw new jException('jelix~formserr.unknow.control',
     38            array($ctrlname, $tpl->_privateVars['__form']->getSelector(),$tpl->_templateName));
     39        }
    3140        $ctrl = $ctrls[$ctrlname];
    3241    }
     42
    3343    if($tpl->_privateVars['__form']->isActivated($ctrlname)) {
    3444        $tpl->_privateVars['__displayed_submits'][$ctrlname] = true;
    3545        $tpl->_privateVars['__formbuilder']->outputControl($ctrl);