Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when installing/upgrading with a DB prefix other than ps_ #207

Closed
wants to merge 6 commits into from

Conversation

Luifer-dnk
Copy link

error when installing/upgrading with a DB prefix other than ps_

error_ps

Renaming to ps_ works but it would be better to have everything with the same prefix.

Thank you.

@ArteInfoRM
Copy link

In the file:
modules/psgdpr/src/Repository/LoggerRepository.php

I changed line 55
$query = $queryBuilder->select('*')->from('ps_psgdpr_log', 'l');

changed to:
$query = $queryBuilder->select('*')->from('' . _DB_PREFIX_ . 'psgdpr_log', 'l');

Now the module configuration is accessed, but the following errors appear in the front-end with active debugging:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "PrestaShop\Module\Psgdpr\Repository\ConsentRepository". Did you mean one of these: "PrestaShop\Module\Psgdpr\Repository\CustomerRepository", "PrestaShop\Module\Psgdpr\Repository\LoggerRepository"? in /var/www/vhosts/mysite.shop/httpdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:289 Stack trace: #0 /var/www/vhosts/mysite.shop/httpdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(231): Symfony\Component\DependencyInjection\Container->make() #1 /var/www/vhosts/mysite.shop/httpdocs/classes/module/Module.php(3443): Symfony\Component\DependencyInjection\Container->get() #2 /var/www/vhosts/mysite.shop/httpdocs/modules/psgdpr/psgdpr.php(740): ModuleCore->get() #3 /var/www/vhosts/mysite.shop/httpdocs/classes/Hook.php(983): Psgdpr->hookDisplayGDPRConsent() #4 /var/www/vhosts/mysite.shop/httpdocs/classes/Hook.php(409): HookCore::coreCallHook() #5 /var/www/vhosts/mysite.shop/httpdocs/classes/Hook.php(918): HookCore::callHookOn() #6 /var/www/vhosts/mysite.shop/httpdocs/config/smarty.config.inc.php(167): HookCore::exec() #7 /var/www/vhosts/mysite.shop/httpdocs/classes/Smarty/SmartyLazyRegister.php(81): smartyHook() #8 /var/www/vhosts/mysite.shop/httpdocs/var/cache/dev/smarty/compile/shopwarehouse/9d/31/f1/9d31f1e356236d39097734c7327c26401ec20ffe_2.module.iqitelementorviewstemplat.php(59): SmartyLazyRegister->__call() #9 /var/www/vhosts/mysite.shop/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_643149537b9714_74762396() #10 /var/www/vhosts/mysite.shop/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #11 /var/www/vhosts/mysite.shop/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render() #12 /var/www/vhosts/mysite.shop/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #13

@fox-john fox-john mentioned this pull request Apr 11, 2023
@matks
Copy link
Contributor

matks commented Apr 12, 2023

Hi @freiserk I think you wanted to report a bug instead of opening a PR

The right page is here https://github.com/PrestaShop/PrestaShop/issues/new?assignees=&labels=Bug%2CNew&template=1_bug_report.yml

I close this PR ;) thank you for reporting the issue

@matks matks closed this Apr 12, 2023
@amazingballzs
Copy link

Hello, I opened the bug report for this issue, I think it is quite urgent to solve it as it a blocking issue, in fact causes also problems in relation to upgrading prestashop from 8.0.2 to 8.0.3.

In practice if one has the tables with prefix different from the default one ps_ if updates the psgdpr module cannot autoupgrade to latest release 8.0.3, if do NOT update psgdpr the autoupgrade process end with success but psgdpr is updated and the old yourprefix_psgdpr_log table is abandoned while a new empty ps_psgdpr_log table is created, this too causes problems.

Considering also the fact that if one before doing anyting try to change the tables prefix to ps_ and edit the file app/config/parameters.php it results into having 500 internal server errors in the backo ffice if debug is disabled and everything apparently working fine if debug is enabled I would say that this bug in psgdpr is truly annoying and causing lots of problems which are well hard to grasp and unsolvable for end users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants