SMFHacks.com

SMF Store => Support => Bugs => Topic started by: shuban on April 17, 2014, 05:43:15 pm

Title: Getting an error on item view
Post by: shuban on April 17, 2014, 05:43:15 pm
2: Invalid argument supplied for foreach()
File: .../public_html/Themes/default/index.template.php
Line: 1494


It corresponds to this:

Code: [Select]
// Create the buttons...
foreach ($button_strip as $key => $value)
{

How do I fix this?
Title: Re: Getting an error on item view
Post by: SMFHacks on April 17, 2014, 06:00:34 pm
It would be part of any store calls that say DoToolBarStrip normally means you aren't passing buttons/it is empty the button array you are passing.
Title: Re: Getting an error on item view
Post by: shuban on April 17, 2014, 06:09:57 pm
True, but how do I stop it from coming up?
Title: Re: Getting an error on item view
Post by: SMFHacks on April 17, 2014, 06:13:46 pm
You would need to trace where it is coming from. If it is item view would be in the template_viewitem function
Title: Re: Getting an error on item view
Post by: shuban on April 17, 2014, 06:24:03 pm
It's this one:

Code: [Select]
<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Product">
<table border="0" cellpadding="0" cellspacing="0" align="center" width="90%">
<tr>
<td style="padding-right: 1ex;" align="right" >
<table cellpadding="0" cellspacing="0" align="right">
<tr>
', DoToolBarStrip($context['store']['buttons_item'], 'bottom'), '
</tr>
</table>
</td>
</tr>

I know because when I delete it, the error goes away. But I can't just delete it... What can I do with it?
Title: Re: Getting an error on item view
Post by: SMFHacks on April 17, 2014, 06:35:33 pm
You probably removed something above $context['store']['buttons_item']
Is what sets that up.