Jump to content

Error after upgrade to latest version 1.6.1.7


Recommended Posts

Hi.
 
After the upgrade to the latest version I get this error:

[PrestaShopException]
Current theme unselected. Please check your theme configuration.
at line 117 in file config/config.inc.php

112. /* Initialize the current Shop */
113. try {
114. $context->shop = Shop::initialize();
115. $context->theme = new Theme((int)$context->shop->id_theme);
116. if ((Tools::isEmpty($theme_name = $context->shop->getTheme()) || !Validate::isLoadedObject($context->theme)) && !defined('_PS_ADMIN_DIR_')) {
117. throw new PrestaShopException(Tools::displayError('Current theme unselected. Please check your theme configuration.'));
118. }
119. } catch (PrestaShopException $e) {
120. $e->displayMessage();
121. }
122. define('_THEME_NAME_', $theme_name);

  • require - [line 27 - index.php]

    22. * @copyright 2007-2016 PrestaShop SA
    23. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
    24. * International Registered Trademark & Property of PrestaShop SA
    25. */
    26.
    27. require(dirname(__FILE__).'/config/config.inc.php');
    28. Dispatcher::getInstance()->dispatch();
     

If I change the Theme to default-bootstrap I get this error:

 

Duplicate entry '28-0-1' for key 'PRIMARY'
INSERT INTO `prstshp_hook_module` (`id_module`, `id_shop`, `id_hook`, `position`)

VALUES (28, 1, 0, 1)

 

Can someone help me out here?

Thanks,

 

João Morais

 

Link to comment
Share on other sites

Probably you was using non native modules before. You need to disable all them, because they will not work with Prestashop 1.6.x

 

On back-office (if you can access) tab: parametros avancados -> desempenho -> bloco mode de duparacao -> set both to YES and save. For security please clear smarty and browser cache too.

Link to comment
Share on other sites

I did what you told me but still not working.

 

When I change the the theme to default-bootstrap I still get this error:

 

Duplicate entry '28-0-1' for key 'PRIMARY'

INSERT INTO `prstshp_hook_module` (`id_module`, `id_shop`, `id_hook`, `position`)
                                    VALUES (28, 1, 0, 1)

Link to comment
Share on other sites

Seems that on your database are duplicate entries for primary keys on prstshp_hook_module. This error says that you are having dublettes in your database. Manipulated manually or due to a table crash on the database. You should check your database for broken tables and repair them.

 

With phpMyAdmin: https://www.siteground.com/tutorials/phpmyadmin/phpmyadmin_optimize_database.htm

 

please check and if there are broken tables, repair them.

Link to comment
Share on other sites

The Prestashop is trying to add for ID 28 on id_shop 1, the id_hook 0 to position 1. This is what the error is saying. So if table psrstshp_hook_module has already an ID_module 28 added, it is not possible to add, and the error is displaying. As I don't know which module on your database has ID 28, it is difficult to help.

 

You can, AFTER making a BACK-UP of your database try to delete the id_module 28 line. This will remove the error and add the line which he is saying he cannot actually add, cause it is still availabe.

 

BTW, Prestashop has no id_hook 0, so it seems that you are having a module installed, which is working with wrong hooks....

Link to comment
Share on other sites

Take a look at the hook and hook module tables you have a module that is tryng to hook into the same position twice or into the same position as a different module.

Make a backup by exporting the database before making changes.

remove one of the 28, 1, 0, 1 entries.

 

28 = modules id #

1 = shop

0 = id of hook - looking at the table there is no 0 id for hooks

1 = position of module within the hook location.

 

 

while you can have a module hooked in several locations (hooks) you can not have 2 modules hooked in the same location.

 

 

looks like we both were typing at the same time

Edited by tdr170 (see edit history)
Link to comment
Share on other sites

Go to table ps_ module and read there the line with id_module 28. Take a look if the module is active and his name. If on column active this module has 1, change it to 0 for to deactivate it. Let us know the name of the module with the id 28.

 

This module is adding a hook_id with 0, which writtenbefore is not possible, cause Prestashop don't use the hook with ID 0. First hook_id should be 1 and not 0.

Link to comment
Share on other sites

Go to table ps_ module and read there the line with id_module 28. Take a look if the module is active and his name. If on column active this module has 1, change it to 0 for to deactivate it. Let us know the name of the module with the id 28.

 

This module is adding a hook_id with 0, which writtenbefore is not possible, cause Prestashop don't use the hook with ID 0. First hook_id should be 1 and not 0.

Read the table ps_modules !! not the back-office.

 

Write only which module is written there (name of it) with the id_module 28.

Link to comment
Share on other sites

OK, so it's blocktopmenu.

 

You have now 2 options: change the activation in ps_modules of this module to 0, or you go to your ftp and delete completely the folder /modules/blocktopmenu. This will make the script inactive at all, and error should disappear. If not, you have to delete smarty cache and browser cache too...

Link to comment
Share on other sites

PS: I've deleted/reworked your posts before, cause you are revealing some crucial data by adding that links.... 

 

You can try to uninstall, or restart the module from back-office, but in this case I prefere to remove it ad infinitum, for to add it as new module to ftp again.... Something is going wrong with the scripts you are having for this module, cause hook id 0 is not available, and this is coming from the script of the module....

 

Delete the module from ftp (or BO), or change the active 1 to 0 on database for it as told before.

Link to comment
Share on other sites

Did you tried to upgrade the shop several times ? module dashactivity is not really a module, but a core feature.... Yes you can deinstall it as well, BUT:

 

If I were you, I will backup all you have now and try to rollback your Prestahop to the old version, which was working before.

If this done, I will try a new upgrade by:

 

Before: deinstall all non-native modules and switch to default theme.

Disable cache module (APC,xCache, memcache, or what else you are using)

And only after this make an upgrade to latest version.

Link to comment
Share on other sites

Probably good advice did you backup of your shop and database before the upgrade if so you could keep going and see what happens then if all else fails do a rollback if that fails  you can use the backup to restore your shop back to 1.5.

 

Always backup everything before upgrading I am sure I do not need to say why at this point.

Link to comment
Share on other sites

Thanks. That did it.

You are a life saver.

Front office is working.

When I try to access BO I get this:

 

Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize in .../classes/Rijndael.php on line 68

Warning: Cannot modify header information - headers already sent by (output started at .../classes/Rijndael.php:68) in .../classes/Cookie.php on line 343

 

Can you help me on that?

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