Help



  • PrestaShopException

    The bcmath extension is required by NumberFormatter.
    at line 113 in file vendor/commerceguys/intl/src/Formatter/NumberFormatter.php

    108.         * @throws \RuntimeException
    109.         */
    110.        public function __construct(NumberFormatInterface $numberFormat, $style = self::DECIMAL)
    111.        {
    112.            if (!extension_loaded('bcmath')) {
    113. =>             throw new \RuntimeException('The bcmath extension is required by NumberFormatter.');
    114.            }
    115.            $availablePatterns = [
    116.                self::DECIMAL => $numberFormat->getDecimalPattern(),
    117.                self::PERCENT => $numberFormat->getPercentPattern(),
    118.                self::CURRENCY => $numberFormat->getCurrencyPattern(),
    
    • CommerceGuys\Intl\Formatter\NumberFormatter->__construct - [line 819 - classes/Tools.php]
    • [2 Arguments]
    814.            if ($tbCurrency->sign) {
    815.                $currency->setSymbol($tbCurrency->sign);
    816.            }
    817.            $numberFormat = $numberFormatRepository->get($languageIso);
    818.    
    819. =>         $currencyFormatter = new NumberFormatter($numberFormat, NumberFormatter::CURRENCY);
    820.    
    821.            return $currencyFormatter->formatCurrency($price, $currency);
    822.        }
    823.    
    824.        /**
    
    CommerceGuys\Intl\NumberFormat\NumberFormat Object
    (
        [locale:protected] => pt
        [numberingSystem:protected] => latn
        [decimalSeparator:protected] => ,
        [groupingSeparator:protected] => .
        [plusSign:protected] => +
        [minusSign:protected] => -
        [percentSign:protected] => %
        [decimalPattern:protected] => #,##0.###
        [percentPattern:protected] => #,##0%
        [currencyPattern:protected] => ¤#,##0.00
        [accountingCurrencyPattern:protected] => ¤#,##0.00;(¤#,##0.00)
    )
    
    Argument [1]  
    3
    
    • ToolsCore::displayPrice - [line 285 - modules/blockcart/blockcart.php]
    • [2 Arguments]
    280.                    $baseShipping = $baseShippingWithTax;
    281.                } else {
    282.                    $baseShipping = $baseShippingWithoutTax;
    283.                }
    284.            }
    285. =>         $shippingCost = Tools::displayPrice($baseShipping, $currency);
    286.            $shippingCostFloat = Tools::convertPrice($baseShipping, $currency);
    287.            $wrappingCost = (float) ($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
    288.            $totalToPay = $params['cart']->getOrderTotal($useTax);
    289.    
    290.            if ($useTax && Configuration::get('PS_TAX_DISPLAY') == 1) {
    
    0
    Argument [1]  
    Currency Object
    (
        [id] => 1
        [name] => Real
        [iso_code] => BRL
        [iso_code_num] => 986
        [sign] => R$
        [blank] => 1
        [conversion_rate] => 1.000000
        [deleted] => 0
        [format] => 3
        [decimals] => 1
        [active] => 1
        [prefix] => R$ 
        [suffix] => 
        [webserviceParameters:protected] => Array
            (
                [objectsNodeName] => currencies
            )
    
        [id_lang] => 
        [id_shop] => 1
        [id_shop_list] => 
        [get_shop_from_context:protected] => 1
        [table:protected] => currency
        [identifier:protected] => id_currency
        [fieldsRequired:protected] => Array
            (
                [0] => name
                [1] => iso_code
                [2] => sign
                [3] => format
                [4] => decimals
                [5] => conversion_rate
            )
    
        [fieldsSize:protected] => Array
            (
                [name] => 32
                [iso_code] => 3
                [iso_code_num] => 3
                [sign] => 8
            )
    
        [fieldsValidate:protected] => Array
            (
                [name] => isGenericName
                [iso_code] => isLanguageIsoCode
                [iso_code_num] => isNumericIsoCode
                [blank] => isInt
                [sign] => isGenericName
                [format] => isUnsignedId
                [decimals] => isBool
                [conversion_rate] => isUnsignedFloat
                [deleted] => isBool
                [active] => isBool
            )
    
        [fieldsRequiredLang:protected] => Array
            (
            )
    
        [fieldsSizeLang:protected] => Array
            (
            )
    
        [fieldsValidateLang:protected] => Array
            (
            )
    
        [tables:protected] => Array
            (
            )
    
        [image_dir:protected] => 
        [image_format:protected] => jpg
        [def:protected] => Array
            (
                [table] => currency
                [primary] => id_currency
                [multilang_shop] => 1
                [fields] => Array
                    (
                        [name] => Array
                            (
                                [type] => 3
                                [validate] => isGenericName
                                [required] => 1
                                [size] => 32
                            )
    
                        [iso_code] => Array
                            (
                                [type] => 3
                                [validate] => isLanguageIsoCode
                                [required] => 1
                                [size] => 3
                            )
    
                        [iso_code_num] => Array
                            (
                                [type] => 3
                                [validate] => isNumericIsoCode
                                [size] => 3
                            )
    
                        [blank] => Array
                            (
                                [type] => 1
                                [validate] => isInt
                            )
    
                        [sign] => Array
                            (
                                [type] => 3
                                [validate] => isGenericName
                                [required] => 1
                                [size] => 8
                            )
    
                        [format] => Array
                            (
                                [type] => 1
                                [validate] => isUnsignedId
                                [required] => 1
                            )
    
                        [decimals] => Array
                            (
                                [type] => 2
                                [validate] => isBool
                                [required] => 1
                            )
    
                        [conversion_rate] => Array
                            (
                                [type] => 4
                                [validate] => isUnsignedFloat
                                [required] => 1
                                [shop] => 1
                            )
    
                        [deleted] => Array
                            (
                                [type] => 2
                                [validate] => isBool
                            )
    
                        [active] => Array
                            (
                                [type] => 2
                                [validate] => isBool
                            )
    
                    )
    
                [classname] => Currency
            )
    
        [update_fields:protected] => 
        [force_id] => 
    )
    
    
    • BlockCart->assignContentVars - [line 242 - modules/blockcart/blockcart.php]
    • [1 Arguments]
    237.                [
    238.                    'order_page'    => (strpos($_SERVER['PHP_SELF'], 'order') !== false),
    239.                    'blockcart_top' => (isset($params['blockcart_top']) && $params['blockcart_top']) ? true : false,
    240.                ]
    241.            );
    242. =>         $this->assignContentVars($params);
    243.    
    244.            return $this->display(__FILE__, 'blockcart.tpl');
    245.        }
    246.    
    247.        /**
    
    
    
    • BlockCart->hookRightColumn - [line 466 - modules/blockcart/blockcart.php]
    • [1 Arguments]
    461.         */
    462.        public function hookTop($params)
    463.        {
    464.            $params['blockcart_top'] = true;
    465.    
    466. =>         return $this->hookRightColumn($params);
    467.        }
    468.    }
    
    
    
    • BlockCart->hookTop - [line 779 - classes/Hook.php]
    • [1 Arguments]
    774.                }
    775.            }
    776.    
    777.            // Immediately return the result if we do not log performances
    778.            if (!Module::$_log_modules_perfs) {
    779. =>             return $module->{$method}($params);
    780.            }
    781.    
    782.            // Store time and memory before and after hook call and save the result in the database
    783.            $timeStart = microtime(true);
    784.            $memoryStart = memory_get_usage(true);
    
    
    
    • HookCore::coreCallHook - [line 497 - classes/Hook.php]
    • [3 Arguments]
    492.    
    493.                    // Call hook method
    494.                    if ($hookCallable) {
    495.                        $display = Hook::coreCallHook($moduleInstance, 'hook'.$hookName, $hookArgs);
    496.                    } elseif ($hookRetroCallable) {
    497. =>                     $display = Hook::coreCallHook($moduleInstance, 'hook'.$retroHookName, $hookArgs);
    498.                    }
    499.    
    500.                    // Live edit
    501.                    if (!$arrayReturn && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad')
    502.                        && Tools::getValue('liveToken') == Tools::getAdminToken(
    
    
    Argument [1]  
    hooktop
    Argument [2]  
    
    
    • HookCore::execWithoutCache - [line 280 - classes/Hook.php]
    • [7 Arguments]
    275.            $checkExceptions = true,
    276.            $usePush = false,
    277.            $idShop = null
    278.        ) {
    279.            if (!Configuration::get('TB_PAGE_CACHE_ENABLED')) {
    280. =>             return static::execWithoutCache($hookName, $hookArgs, $idModule, $arrayReturn, $checkExceptions, $usePush, $idShop);
    281.            }
    282.    
    283.            $activehooks = json_decode(Configuration::get('TB_PAGE_CACHE_HOOKS'), true);
    284.    
    285.            $found = false;
    
    displayTop
    Argument [1]  
    
    Argument [2]  
    
    Argument [3]  
    
    Argument [4]  
    1
    Argument [5]  
    
    Argument [6]  
    
    
    • HookCore::exec - [line 278 - classes/controller/FrontController.php]
    • [1 Arguments]
    273.                $hook_header .= $extra_code['PS_CUSTOMCODE_METAS'].$extra_css;
    274.    
    275.                $this->context->smarty->assign(
    276.                    [
    277.                        'HOOK_HEADER'       => $hook_header,
    278. =>                     'HOOK_TOP'          => Hook::exec('displayTop'),
    279.                        'HOOK_LEFT_COLUMN'  => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
    280.                        'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', ['cart' => $this->context->cart]) : ''),
    281.                    ]
    282.                );
    283.            } else {
    
    displayTop
    
    • FrontControllerCore->initContent - [line 53 - controllers/front/IndexController.php]
    48.         *
    49.         * @since 1.0.0
    50.         */
    51.        public function initContent()
    52.        {
    53. =>         parent::initContent();
    54.            $this->addJS(_THEME_JS_DIR_.'index.js');
    55.    
    56.            $this->context->smarty->assign(
    57.                [
    58.                    'HOOK_HOME'             => Hook::exec('displayHome'),
    
    • IndexControllerCore->initContent - [line 390 - classes/controller/Controller.php]
    385.                    if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
    386.                        $this->initHeader();
    387.                    }
    388.    
    389.                    if ($this->viewAccess()) {
    390. =>                     $this->initContent();
    391.                    } else {
    392.                        $this->errors[] = Tools::displayError('Access denied.');
    393.                    }
    394.    
    395.                    if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
    
    • ControllerCore->run - [line 742 - classes/Dispatcher.php]
    737.                if (isset($paramsHookActionDispatcher)) {
    738.                    Hook::exec('actionDispatcher', $paramsHookActionDispatcher);
    739.                }
    740.    
    741.                // Running controller
    742. =>             $controller->run();
    743.            } catch (PrestaShopException $e) {
    744.                $e->displayMessage();
    745.            }
    746.        }
    747.    
    
    • DispatcherCore->dispatch - [line 33 - index.php]
    28.     *  @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
    29.     *  PrestaShop is an internationally registered trademark & property of PrestaShop SA
    30.     */
    31.    
    32.    require(dirname(__FILE__).'/config/config.inc.php');
    33. => Dispatcher::getInstance()->dispatch();
    


  • Sorry for this silly problem, I’m very tired and went unnoticed, it was only install module BCMATH that everything worked perfectly


  • administrators

    How did you install tb without bcmath? That shouldn’t be possible.



  • @mdekker

    apt-get install php7.0-bcmath

    :)


  • Global Moderator

    @Anima did you install thirty bees using the command line installer?
    install/index_cli.php

    @mdekker if yes then he probably hit the bug in https://github.com/thirtybees/thirtybees/issues/181


  • administrators

    Hmmz postponed due to too many changes. That’s not right I think.



  • It was installed by the browser normally in another VPS, so I had to move the store to another server and did the normal migration.
    I downloaded the files from the server and uploaded the other files.
    I use VPS configured by myself, Ubuntu 17.04 (I will migrate to debian 9, 16.04 was with bugs) Apache2, php 7 and ISPConfig


  • Global Moderator

    Ah, so the whole stored was just moved from one host to another. That would obviously bypass all the installation checks.

    That’s an interesting use case that the code doesn’t take into consideration now.

    In general when something crazy happens it’s a smart thing to go into the thirty bees admin, and then to the page ‘Advanced Parameters’ 'Configuration Parameters’
    This page would have reported the missing bcmath addon.


  • Global Moderator

    Actually there’s Backoffice -> Advanced Parameters -> Configuration Information, which does these installation tests entirely without the installer. Just go to that page.



  • Yes, but only informs that a problem exists, does not distinguish the problem.


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.