Hi update my website for testing to xoops 2.0.15 but after install xhld i get this messages:
Quote:
Fatal error: Call to a member function on a non-object in /var/www/xoops/class/xoopsform/form.php on line 193
I have the 3.05 xhld version in xoops 2.0.15
Some bug ?
greetings
sorry my english is poor
It looks some kind of incompatibilities.
I have to check 2.0.15
It looks an original bug of xoopsform.
In class/xoopsform/form.php
$this->_elements can be a string instead of object.
refer method addElements() and XoopsThemeForm::insertBreak().
Thus, it must be ...
function &getElements($recurse = false){
if (!$recurse) {
return $this->_elements;
} else {
$ret = array();
$count = count($this->_elements);
for ($i = 0; $i < $count; $i++) {
if ( ! is_object( $this->_elements[$i] ) ) {
$ret[] = $this->_elements[$i];
} else if (!$this->_elements[$i]->isContainer()) {
$ret[] =& $this->_elements[$i];
} else {
$elements =& $this->_elements[$i]->getElements(true);
$count2 = count($elements);
for ($j = 0; $j < $count2; $j++) {
$ret[] =& $elements[$j];
}
unset($elements);
}
}
return $ret;
}
}
This report should be sent to skalpa.
(modified from is_string() to ! is_object()
Many thanks, GIJOE, this bug was also preventing the use of regcodes&formulize on Xoops 2.0.15. All looks fine now.
another solution which seems more reliable and which will take all the possibilities
function &getElements($recurse = false){
if (!$recurse) {
return $this->_elements;
} else {
$ret = array();
$count = count($this->_elements);
for ($i = 0; $i < $count; $i++) {
if ( is_object( $this->_elements[$i] ) ) {
if (!$this->_elements[$i]->isContainer()) {
$ret[] =& $this->_elements[$i];
} else {
$elements =& $this->_elements[$i]->getElements(true);
$count2 = count($elements);
for ($j = 0; $j < $count2; $j++) {
$ret[] =& $elements[$j];
}
unset($elements);
}
}
}
return $ret;
}
}
Thank you for suggestion.
I've fixed.