MrPhil, on 09 July 2012 - 02:28 PM, said:
You're going to have to look back up through the code to see where $id was last set before being used in line 85. Was there some other code change (add-on or manual edit) that might have accidentally repurposed $id? Or was $id originally a string for some other purpose, and someone/something removed the repurposing of it to an array? In either case, this shows the great weakness of untyped or weakly typed languages
Thanks for responding Phil,
The only time the $id is used prior to line 85 is on line 68.
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
function FAQDesk_show_category($counter) {
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
(line 68) global $foo_faqdesk, $categories_faqdesk_string, $id;
for ($a=0; $a<$foo_faqdesk[$counter]['level']; $a++) {
$categories_faqdesk_string .= " ";
}
$categories_faqdesk_string .= '<a href="';
if ($foo_faqdesk[$counter]['parent'] == 0) {
$faqPath_new = 'faqPath=' . $counter;
} else {
$faqPath_new = 'faqPath=' . $foo_faqdesk[$counter]['path'];
}
$categories_faqdesk_string .= tep_href_link(FILENAME_FAQDESK_INDEX, $faqPath_new);
$categories_faqdesk_string .= '">';
if ( ($id) && (in_array($counter, $id)) ) {
$categories_faqdesk_string .= '<b>';
}
Then you see it again beginning on line 168
//------------------------
if ($faqPath) {
$new_path = '';
// $id = split('_', $faqPath);
(line 168) $id = preg_split('/_/', $faqPath);
reset($id);
while (list($key, $value) = each($id)) {
unset($prev_id);
unset($first_id);
$categories_faqdesk_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_FAQDESK_CATEGORIES . " c, "
. TABLE_FAQDESK_CATEGORIES_DESCRIPTION . " cd where c.catagory_status = '1' and c.parent_id = '" . $value . "'
and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
$category_faqdesk_check = tep_db_num_rows($categories_faqdesk_query);
if ($category_faqdesk_check > 0) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_faqdesk_query)) {
$foo_faqdesk[$row['categories_id']] = array(
'name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false
);
That's it for the whole file.
Thanks for helping,
Leon



Find content
Not Telling
