Jump to content
thirty bees forum
  • 0

Error when switching them in TB1.07


Question

Posted

Hi,

I just tried to install a theme and got an error. Swtching on the debug mode gives following information. Same theme is working on 1.06 version. What is wrong?

Warning: Declaration of Link::getImageLink($name, $ids, $type = NULL, $rollover = NULL) should be compatible with LinkCore::getImageLink($name, $ids, $type = NULL, $format = 'jpg', $highDpi = false) in /home/xxxxx/domains/xxx/public_html/shop/override/classes/Link.php on line 0 [ThirtyBeesException]

Too few arguments to function SmartyLazyRegister::register(), 1 passed in /home/xxx/domains/xxx/public_html/shop/modules/prestapassionsmartcodes/prestapassionsmartcodes.php on line 258 and exactly 3 expected at line 237 in file config/smarty.config.inc.php

  1. /**
    • Register a function or method to be dynamically called later
    • @param string|array $params function name or array(object name, method name)
  2. */
  3. public function register($name, $type, $callable)
  4. {
  5. $this->registry[$name] = [
  6. 'callable' => $callable,
  7. 'type' => $type
  8. ];

5 answers to this question

Recommended Posts

  • 0
Posted

@datakick

Thanks for you fast reaction. Below the code.

/* ------------------------------------------------------------- / / /* FRONT OFFICE RELATED STUFF /* /* ------------------------------------------------------------- */

/* ------------------------------------------------------------- */
/*  PREPARE FOR HOOK
/* ------------------------------------------------------------- */

private function _prepHook($params)
{
    $this->context->smarty->assignGlobal('PRESTAPASSIONSMARTCODES_ENABLE', Configuration::get('PRESTAPASSIONSMARTCODES_ENABLE'));

    // Register prestapassionProcessSmartCodes smarty plugin
    $lazyRegister = SmartyLazyRegister::getInstance();
    $lazyRegister->register(array('prestapassionSmartCodesProcessor', 'prestapassionProcessSmartCodes'));

    $this->context->smarty->registerPlugin('function', 'prestapassionProcessSmartCodes', array($lazyRegister, 'prestapassionProcessSmartCodes'));
}


/* ------------------------------------------------------------- */
/*  HOOK (displayFooterSocialLinks)
/* ------------------------------------------------------------- */
public function hookDisplayHeader($params)
{
    $this->_prepHook($params);
}

}

  • 0
Posted

@piet could you please modify config/smarty.config.inc.php, and change function register inside SmartyLazyRegister class to this (including function signature!):

```php public function register($name, $type='function', $callable=null) { if (isnull($callable)) { if (isarray($name) && count($name) === 2) { $callable = $name; $name = $name[1]; } else { throw new PrestaShopException("Invalid usage of SmartyLazyRegister::register"); } } $this->registry[$name] = [ 'callable' => $callable, 'type' => $type ]; }

```

  • 0
Posted

@datakick Modified your code and it works like it should. Thanks for your fast reply and the solution.

@lesley This is exactly an example why people should switch to Thirty Bees :) Me happy!

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
×
×
  • Create New...