21
@Mage posted already here the answer to the disappearing categories but for a different module
https://xoops.org/modules/newbb/viewtopic.php?post_id=362031#362031open modules/tdmpicture/class/tree.php and replace this code (line 41 - 68)
public function _makeArrayTreeOptions($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
{
if ($key > 0) {
$value = $this->tree[$key]['obj']->getVar($this->myId);
$ret[$value] = $prefix_curr . $this->tree[$key]['obj']->getVar($fieldName);
$prefix_curr .= $prefix_orig;
}
if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
foreach ($this->tree[$key]['child'] as $childkey) {
$this->_makeArrayTreeOptions($fieldName, $childkey, $ret, $prefix_orig, $prefix_curr);
}
}
}
/**
* @param $fieldName
* @param string $prefix
* @param int $key
* @return array
*/
public function makeArrayTree($fieldName, $prefix = '-', $key = 0)
{
$ret = array();
$this->_makeArrayTreeOptions($fieldName, $key, $ret, $prefix);
return $ret;
}
with following
protected function makeArrayTreeOptions($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
{
if ($key > 0) {
$value = $this->_tree[$key]['obj']->getVar($this->_myId);
$ret[$value] = $prefix_curr . $this->_tree[$key]['obj']->getVar($fieldName);
$prefix_curr .= $prefix_orig;
}
if (isset($this->_tree[$key]['child']) && !empty($this->_tree[$key]['child'])) {
foreach ($this->_tree[$key]['child'] as $childKey) {
$this->makeArrayTreeOptions($fieldName, $childKey, $ret, $prefix_orig, $prefix_curr);
}
}
}
/**
* @param $fieldName
* @param string $prefix
* @param int $key
* @return array
*/
public function makeArrayTree($fieldName, $prefix = '-', $key = 0) {
$ret = array();
$this->makeArrayTreeOptions($fieldName, $key, $ret, $prefix);
return $ret;
}