ST Shop

Started by Diego Andrés, February 02, 2014, 06:32:27 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dubanblack

Hola,

Quería saber si existe alguna forma de solucionar este error que aparece constantemente:

bfe9d4f4ea00ea388c9e2526601ee4c6
https://harrypotterhead.com/foro/index.php?action=shop
/home/u964766853/domains/harrypotterhead.com/public_html/foro/Themes/default/Shop/Shop.template.php (Línea 41)
2: Trying to access array offset on value of type null
URL de la página causante del error
https://harrypotterhead.com/foro/index.php?action=shop

#0: smf_error_handler()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Themes/default/Shop/Shop.template.php en línean 41
#1: template_shop_above()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Load.php en línean 2778
#2: loadSubTemplate()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Subs.php en línean 4554
#3: template_header()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Subs.php en línean 4157
#4: obExit()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Security.php en línean 143
#5: is_not_guest()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Security.php en línean 1035
#6: isAllowedTo()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Shop/View/Home.php en línean 176
#7: main()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/index.php en línean 184

La línea 41 es esta:
foreach ($context['shop']['tabs'] as $action => $tab)
He notado que las ip que aparecen siempre usan VPN. Existe alguna forma de evitar ese error?

Diego Andrés

Intenta lo siguiente:

Sources/Shop/View/Home.php

Code (Search) Select
$context['template_layers'][] = 'shop';

// What if the Shop is disabled? User shouldn't be able to access the Shop
if (empty($modSettings['Shop_enable_shop']))
fatal_error(Shop::getText('currently_disabled'), false);

// Are they allowed to Access the Shop? If not.. YOU SHALL NOT PASS.
// Anyway if user can Manage the Shop, there's no problem :).
if (!empty($modSettings['Shop_enable_shop']) && !allowedTo('shop_canAccess') && !allowedTo('shop_canManage'))
isAllowedTo('shop_canAccess');

// Maintenance. Only Shop admins can access.
if (!empty($modSettings['Shop_enable_shop']) && !empty($modSettings['Shop_enable_maintenance']) && allowedTo('shop_canAccess') && !allowedTo('shop_canManage'))
fatal_error(Shop::getText('currently_maintenance'), false);

Code (Replace) Select
// What if the Shop is disabled? User shouldn't be able to access the Shop
if (empty($modSettings['Shop_enable_shop']))
fatal_error(Shop::getText('currently_disabled'), false);

// Are they allowed to Access the Shop? If not.. YOU SHALL NOT PASS.
// Anyway if user can Manage the Shop, there's no problem :).
if (!empty($modSettings['Shop_enable_shop']) && !allowedTo('shop_canAccess') && !allowedTo('shop_canManage'))
isAllowedTo('shop_canAccess');

// Maintenance. Only Shop admins can access.
if (!empty($modSettings['Shop_enable_shop']) && !empty($modSettings['Shop_enable_maintenance']) && allowedTo('shop_canAccess') && !allowedTo('shop_canManage'))
fatal_error(Shop::getText('currently_maintenance'), false);

$context['template_layers'][] = 'shop';

dubanblack

Muchas gracias, funciona bien, de momento no se han reportado nuevamente esos errores.