I developed a joomla module, it was working fine. When it was published once but when i published it again on same page, then home page gone and i got 500 error, and if I tried to unpublished one module both got unpublished.
How to resolve that issue. As a guess i think i should create a dynamic id with every module. but i dont know how to do that in joomla.
This code is making problems.
function group_by_key($array) {
$result = array();
foreach ($array as $sub) {
foreach ($sub as $k => $v) {
$result[$k][] = $v;
}
}
return $result;
}
$features_list = array(
$features_list1 = group_by_key($features[0]),
$features_list2 = group_by_key($features[1]),
$features_list3 = group_by_key($features[2]),
$features_list4 = group_by_key($features[3]),
);
Because i am getting below error.
Fatal error: Cannot redeclare group_by_key() (previously declared in E:\xampp\htdocs\joomla\do\modules\mod_xp_comparison\tmpl\default.php:31) in E:\xampp\htdocs\joomla\do\modules\mod_xp_comparison\tmpl\default.php on line 40