geodesicsolutions-community / geocore-community

GeoCore Community, open source classifieds and auctions software
MIT License
9 stars 6 forks source link

default template count must be array, not null #227

Open iBeleave opened 5 months ago

iBeleave commented 5 months ago

a few of these errors still exist in the templates, using count:

geo_templates\default\system\user_management\information\final_fee_table.tpl geo_templates\default\system\user_management\information\price_plan_info.tpl - {if count($ffRows) > 0} + {if $ffRows}

geo_templates\default\system\user_management\expired_ads_expired_ad_details - {if $ad->PRICE_APPLIES == 'item' && count($bids) > 0} + {if $ad->PRICE_APPLIES == 'item' && $bids}

- {if count($bids) > 0} + {if $bids}

An alternative fix is to just add an additional Smarty modifier address the count issue in templates

function smarty_modifier_count($var, $mode=0)
{
    if (is_countable($var)) {
    return count($var, $mode);
    }
    else {
    return '';
    }
}