additional
Home > Forum > Joomla components > Comparison Chart > Chart items not showing - internal servererror 500
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Chart items not showing - internal servererror 500

Chart items not showing - internal servererror 500 2 years 10 months ago #25291

Hi,

I just bought and installed Comparison Chart. Everything seems to work fine until I tried to create a menu item that shows Chart Items.
When I try to click the menu I get a blank page. The console log show an internal error 500.
When I check the error logs it gives me the following error:

PHP Parse error: syntax error, unexpected 'else' (T_ELSE) in D:\\uniserver_v1103\\UniServerZ\\www\\jlBelagroup\\components\\com_comparisonchart\\views\\items\\tmpl\\default.php on line 111

I have created two items and put them in the same category.
Also when I create a menu to show category, it works fine but when I click the category with the items in it, no items are showing either.

Please advice.

Thanks in advance!
The administrator has disabled public write access.

Chart items not showing - internal servererror 500 2 years 10 months ago #25292

Alright, I found the problem. There is a bug in the code. (small typo error)

I found the following code in the default.php file:
<div class="compare-block"  id="chart-notice">
    <?php
 
    // $count_compare=count($app->getUserState('com_comparisonchart.chart'.intval($this->chart->id)));
    if(!count($this->compare)){
        $session =JFactory::getSession();
        $this->compare=$session->get('com_comparisonchart.chart'.$this->chart->id);
    }
    $count_compare = count($this->compare);
    if ($count_compare > 0) {
        echo $count_compare . ' item(-s) <a href="#" onclick="jQuery(\'#charts-form\').submit();">added to compare.</a>';
        $ids = array();
        $ids = array_keys($this->compare);?>
        <script type="text/javascript">
            jQuery(document).ready(function () {
                <?php    for($i=0; $i<count($ids); $i++){
                        ?>
 
 
                jQuery('#item<?php echo $ids[$i];?>').prop('checked', true);
                jQuery("label[for='item<?php echo $ids[$i];?>']").addClass('c_on');
 
                <?
                    }?>
            });
        </script>
    <?php
    } else {
        echo 'No items selected.';
    }?>
 
</div>

Just above where "</script"> ends, you see:
<?
}?>

I changed it to:
<?php
}?>

Now it works.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.153 seconds