Skip to content
Snippets Groups Projects
Commit 5628eb78 authored by Peter Rotich's avatar Peter Rotich
Browse files

forms: Fix form field uid

Automated $uid is initialized as null - this resulted in the initial field
getting a null id.
parent fbcd756c
No related branches found
No related tags found
No related merge requests found
......@@ -540,15 +540,19 @@ class FormField {
static $more_types = array();
static $uid = null;
function _uid() {
return ++self::$uid;
}
function __construct($options=array()) {
$this->ht = array_merge($this->ht, $options);
if (!isset($this->ht['id']))
$this->ht['id'] = self::$uid++;
$this->ht['id'] = self::_uid();
}
function __clone() {
$this->_widget = null;
$this->ht['id'] = self::$uid++;
$this->ht['id'] = self::_uid();
}
static function addFieldTypes($group, $callable) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment