Jump to content

Problème MAJ PHP : undefined index: category in & trying to get property of non-object in


FHP
 Share

Recommended Posts

Bonjour à tous,

Depuis que j'ai mis à jour la version PHP de mon site via la console de mon hébergeur (Infomaniak), j'ai ces lignes qui apparaissent sur l'ensembles des pages de mon site, une fois que je suis connecté à mon compte client :

NOTICE: UNDEFINED INDEX: HOMEPAGE IN /HOME/CLIENTS/8F50332D2BC514CFFE63C768874D50F7/WEB2/E-COMMERCE/CACHE/SMARTY/COMPILE/67/B2/D8/67B2D860FE46C1B083AA452C06F377206DBAD73B.FILE.BLOCKUSERINFO.TPL.PHPON LINE 39

NOTICE: TRYING TO GET PROPERTY OF NON-OBJECT IN /HOME/CLIENTS/8F50332D2BC514CFFE63C768874D50F7/WEB2/E-COMMERCE/CACHE/SMARTY/COMPILE/67/B2/D8/67B2D860FE46C1B083AA452C06F377206DBAD73B.FILE.BLOCKUSERINFO.TPL.PHPON LINE 39 

J'ai donc essayé de vider le cache et, sur les conseils de mon hébergeur, de  "Forcer la compilation à chaque appel", de me connecter à nouveau au compte du site et de remettre "Recompilez les fichiers de templates s'ils ont été mis à jour" dans performance > smarty : aucun changement.

Voici le code PHP autour de la ligne 39 suivi des lignes correspondant au .tpl apparaissant dans les lignes:

PHP:

<?php if ($_smarty_tpl->tpl_vars['is_logged']->value) {?>			
		<a class="btn-xs user dropdown-toggle" data-toggle="dropdown" class="login account" href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account',true);?>
" title="<?php echo smartyTranslate(array('s'=>'View my customer account','mod'=>'blockuserinfo'),$_smarty_tpl);?>
" rel="nofollow">
			<span class="text-box"><?php echo $_smarty_tpl->tpl_vars['cookie']->value->customer_firstname;?>
ligne 39 </span><?php if ($_smarty_tpl->tpl_vars['homepage']->value!=1||$_smarty_tpl->tpl_vars['homepage']->value!=5) {?><span class="lnr lnr-chevron-down"></span><?php }?>
		</a>
	<?php } else { ?>
		<a class="btn-xs user dropdown-toggle" data-toggle="dropdown" class="login" href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account',true);?>
" title="<?php echo smartyTranslate(array('s'=>'Login to your customer account','mod'=>'blockuserinfo'),$_smarty_tpl);?>
" rel="nofollow">
			<span class="text-box"><?php echo smartyTranslate(array('s'=>'Login','mod'=>'blockuserinfo'),$_smarty_tpl);?>
</span>
			<span class="lnr lnr-chevron-down"></span>
		</a>
	<?php }?>

 

TPL :

		<li id="your_account"><a href="{$link->getPageLink('my-account', true)|escape:'html'}" title="{l s='View my customer account' mod='blockuserinfo'}" rel="nofollow">{l s='Your Account' mod='blockuserinfo'}</a></li>
	</ul>
	<p id="header_user_info">
		{l s='Welcome' mod='blockuserinfo'}
		{if $logged}
			<a href="{$link->getPageLink('my-account', true)|escape:'html'}" title="{l s='View my customer account' mod='blockuserinfo'}" class="account" rel="nofollow"><span>{$cookie->customer_firstname} {$cookie->customer_lastname}</span></a>
			<a href="{$link->getPageLink('index', true, NULL, "mylogout")|escape:'html'}" title="{l s='Log me out' mod='blockuserinfo'}" class="logout" rel="nofollow">{l s='Sign out' mod='blockuserinfo'}</a>
		{else}
			<a href="{$link->getPageLink('my-account', true)|escape:'html'}" title="{l s='Log in to your customer account' mod='blockuserinfo'}" class="login" rel="nofollow">{l s='Sign in' mod='blockuserinfo'}</a>
		{/if}
	</p>
</div>

 

J'ai également ce même type de lignes qui apparait sur la page spécifique à mon compte client :

notice: undefined index: category in /home/clients/8f50332d2bc514cffe63c768874d50f7/web2/e-commerce/cache/smarty/compile/90/71/a6/9071a6f3497ce9173378a297153a0b49b1fbadd2.file.breadcrumb.tpl.php on line 54

notice: trying to get property of non-object in /home/clients/8f50332d2bc514cffe63c768874d50f7/web2/e-commerce/cache/smarty/compile/90/71/a6/9071a6f3497ce9173378a297153a0b49b1fbadd2.file.breadcrumb.tpl.php on line 54

Voici les codes PHP autour de la ligne 54 :

PHP

<span class="category-description pull-right">
	ligne 54		<?php echo $_smarty_tpl->tpl_vars['category']->value->description;?>

		</span>
	</div>
</div>
<?php if (isset($_GET['search_query'])&&isset($_GET['results'])&&$_GET['results']>1&&isset($_SERVER['HTTP_REFERER'])) {?>
<div class="pull-right">
	<strong>

TPL

<div class="breadcrumb">
	<div class="container">
		<a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}">{l s='Home'}</a>
		{if isset($path) AND $path}
			<span class="navigation-pipe"{if isset($category) && isset($category->id_category) && $category->id_category == (int)Configuration::get('PS_ROOT_CATEGORY')} style="display:none;"{/if}>/</span>
			{if $path|strpos:'span' !== false}
				<span class="navigation-pipe">{$path|@replace:'<a ': '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" '|@replace:'data-gg="">': '><span itemprop="title">'|@replace:'</a>': '</span></a></span>'}</span>
			{else}
				{$path}
			{/if}
		{/if}
		<span class="category-description pull-right">
			{$category->description}
		</span>
	</div>
</div>
{if isset($smarty.get.search_query) && isset($smarty.get.results) && $smarty.get.results > 1 && isset($smarty.server.HTTP_REFERER)}
<div class="pull-right">
	<strong>
		{capture}{if isset($smarty.get.HTTP_REFERER) && $smarty.get.HTTP_REFERER}{$smarty.get.HTTP_REFERER}{elseif isset($smarty.server.HTTP_REFERER) && $smarty.server.HTTP_REFERER}{$smarty.server.HTTP_REFERER}{/if}{/capture}
		<a href="{$smarty.capture.default|escape:'html':'UTF-8'|secureReferrer|regex_replace:'/[\?|&]content_only=1/':''}" name="back">
			<i class="icon-chevron-left left"></i> {l s='Back to Search results for "%s" (%d other results)' sprintf=[$smarty.get.search_query,$smarty.get.results]}
		</a>
	</strong>
</div>

 

Merci beaucoup beaucoup beaucoup de votre aide ! 

 

A vous lire !

FH

Edited by FHP (see edit history)

Share this post


Link to post
Share on other sites

Encore une conseilleur/hébergeur qui ferait mieux de se lancer dans l'élevage des vers à soie dans le bas Quercy.

NE PAS RECOMPILER A CHAQUE APPEL (sauf a vouloir un site brouette)

Désactive le mode DEBUG et/ou corrige les templates (indice les 2 composants que tu montre compilé/non-compilé) ne traitent pas du même code ... cherche homepage plutot

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More