Prestashop: Redirected to controller=AdminDashboard

Created on 25 Feb 2020  路  32Comments  路  Source: PrestaShop/PrestaShop

When I click the Design > Pages , the page is redirected to this url:
https://mydomain.com/xxx/index.php/improve/design/cms-pages/index.php?controller=AdminDashboard&token=dbd75324ee2de9a115ee83ec8797709d

Also I attempted to solve the issue with these steps:

  • clearing cache in BO
  • deleting var/cache/prod and dev
  • regenerated the .htaccess file through toggling the friendly URL config
  • also checked for any class that overrides something.. and disabled all of them
  • disabled all non-presta modules

but not happened

1.7.6.3 Autoupgrade BO Bug Can't Reproduce Pages

All 32 comments

also I changed the php version from 5.6 to 7.2

Hello @vhessam ,
Could you please provide us with more info? We need more details to understand how we can reproduce your issue:

Info is as follows:

  • Using Cpanel
  • Psv 1.7.6.3
  • with debug mode turned on nothing shown, no warning no exception
  • this is the screenshot from my chrome console when I click _pages_
    Screen Shot 2020-02-26 at 2 30 48 PM

I also tried to debug the code... with just echo.. to track the process of redirecting. And I found out that it occurs in dispatch method in class DispatcherCore. The request does not reach CmsPageController even. Inside the dispatcher it will redirect to the dashboard page.

Hello @vhessam ,
I see that there is an error with dh42.js, it seems to be a js from a module. Could you check with the developers of that module please ?
Thanks, please give us a feedback.

Hello @florine2623,
I just removed the module, but problem persists

Hello @vhessam ,
Noted. Now, could you send me these :

  • PHP error logs
  • apache error log

Thanks for the feedback.

I've uploaded the error logs on google drive.
This is for apache errors:
https://drive.google.com/open?id=13D3wThE-kwBOCqK5i9RecrEhCEYhihkf
And this is for symfony in : /var/logs/prod.log
https://drive.google.com/open?id=1QsSa-YkRNB_T3lg92ocLzzOayqEQd3E4

I noticed a log:
[2020-02-26 09:18:41] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load class "CmsPageController" from the global namespace. Did you forget a "use" statement for "PrestaShopBundle\Controller\Admin\Improve\Design\CmsPageController"?" at /home/ctmdeshop/public_html/classes/controller/Controller.php line 219 {"exception":"[object] (Symfony\Component\Debug\Exception\ClassNotFoundException(code: 0): Attempted to load class \"CmsPageController\" from the global namespace.\nDid you forget a \"use\" statement for \"PrestaShopBundle\Controller\Admin\Improve\Design\CmsPageController\"? at /home/ctmdeshop/public_html/classes/controller/Controller.php:219)"} []

Hi @vhessam
After checking your log errors, I encountered this error :

[2020-02-25 18:02:58] app.ERROR: Exception thrown by module elp_optimizeadmin on disable. Error when disabling module elp_optimizeadmin. Class ToolsOverride_remove5e558b825a236 does not exist. [] []

Could you check if that module might be linked with you redirection issue ?

Please check and give us feedback.
Thanks!

I uninstalled this module.. nothing happened.
As you see in the log, I don know why the CmsPageController class could not be loaded.

Hello @vhessam ,

Is it a PS fresh install 1.7.6.3 ? Or is it an upgrade (with 1-click upgrade or not) ?

Thanks to check & feedback.

Yes we upgraded. But from a minor version. something like 1.7.6.2 to 1.7.6.3

Hello @vhessam ,

Please check if you have any error on the upgrade. And send me the log file so I can see if there are errors.
admin/autoupgrade/tmp/log.txt

Thanks to check & feedback.

I uploaded on google drive. here is the link:
https://drive.google.com/open?id=1D3VI-AF8HqPCtMNk1gyZ74tWBMnhkf_9

Thanks @florine2623

@vhessam
Despite our several trials, we could not reproduce your issue with the provided information.

Here's the screen record to the upgrade and issue :
https://drive.google.com/file/d/1OwBWOZlOBXV2atmEO8kwlFpeMltYnb4E/view
https://drive.google.com/file/d/1GuTRamnYjqsmi_prvrri5E61AwyOBzw1/view

Plus, you can check if you CmsPageController.php is the same as this one : https://github.com/PrestaShop/PrestaShop/blob/1.7.6.3/src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php

Thanks to check & feedback.

Thanks. But files are identical. Based on the log, it notes that it can not find the class CmsPageController.php and will be redirected..
Screen Shot 2020-02-26 at 8 58 10 PM

anyway, I'm trying to fix this issue. Thanks so much @florine2623

Another info: I noticed that we have upgraded the website from 1.7.5.2 to 1.7.6.3.

PS 1.7.6.3 Back Office bug
By clicking on MENU DESIGN> Pages, prestashop takes you to the Home Panel.

There is no technical support material in the forums.
I am accompanying Hesam in treating this type of problem.

Hi @vhessam,

Thanks to try with these steps:

  1. Make of backup of your files and your database to be safe
  2. Rename the vendor folder to vendor_old into your Project_folder/
  3. Create a file composer.json & copy-paste from here: https://github.com/PrestaShop/PrestaShop/blob/1.7.6.3/composer.json
  4. Run composer install => all dependencies will be regenerated
  5. Try to clear the cache manually by deleting all the folders into var/cache (prod & dev).

Thanks to check and feedback.

Hi @khouloudbelguith
Already I created composer.json and run composer dump-reload. But now I do what you said to reinstall dependencies.
Thanks

@vhessam,

The best difference between composer update and composer install

  1. composer install
    To add dependencies you need to add it manually to the composer.json file.
  2. composer update
    To add or remove dependencies you need to add it manually to the composer.json file

Waiting for your feedback.

OK thanks @khouloudbelguith I'm following.. ;)

@vhessam, waiting for the feedback:slightly_smiling_face:

Screen Shot 2020-02-27 at 3 16 48 PM

@khouloudbelguith I ran the composer install successfully. And cleaned the cache dir var/cache(dev&prod). Problem persists.
I think after upgrade our presta app can not autoload CmsPageController.

Many thanks

@vhessam, so, it could be something went wrong with your update and don't have some of the database columns that were added for 1.7.6.3
The solution is to check if there are missing columns in your database schema.
You can find the full schema for 1.7.6.3 here: https://github.com/PrestaShop/PrestaShop/blob/1.7.6.3/install-dev/data/db_structure.sql
Thanks to check & feedback.

Ok I gonna compare the schemas. Thanks @khouloudbelguith

@vhessam, waiting for the feedback:slightly_smiling_face:

@khouloudbelguith I used a fresh PrestaShop installation and a clone of our database to see the schema difference.
There is really no difference from the fresh presta installation just some indexes. I uploaded my screen record on the google drive you can see it:
https://drive.google.com/open?id=11O5oHc0wAMSwntmRh20wNbHpAlEg3SQx

As an explanation, the left side is our database schema and the right side is the fresh presta. Naturally our database has some more table and columns than the fresh presta.
Thanks

@vhessam,

Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.
I tried to make an upgrade from PS1.7.5.2 to PS1.7.6.3 using the 1-click upgrade v4.10.1 => OK
https://drive.google.com/file/d/1zrf-TXD3qIjrGZYH7V3LE3xP4easK90y/view
I invite you to contact our support team: http://addons.prestashop.com/en/388-support to help you solve your issue.

Thanks!

No customization was done in our PrestaShop, at the Back Office level. Nothing has been changed.

Our server is a Cent OS 7, with Apache, Cpanel / WHM, a standard VPS cloud model.

In that case, if there are problems with something, it is some native incompatibility of PrestaShop.

I remember that version 1.7.6 is being very poorly evaluated by the developers in my country. Exit version, enter version and PrestaShop continues with many problems.

My team has already lost 03 days of work trying to solve this BUG

@khouloudbelguith with too much debugging problem solved. I figured out that the problem was permission denied! So I replaced the ps_access and ps_authorization with a fresh one.. so issue gone..
Thanks for your support

I can confirm the bug. It doesn't only happen with the said controller but with many of them, they keep redirecting to AdminDashboard. I will try to add mi to ps_access my id_profile with all id_authorization_role the with the following SQL:

INSERT IGNORE INTO ps_access (id_profile, id_authorization_role)
SELECT 1, id_authorization_role FROM ps_authorization_role

NOTE: For me this didn't solve the issue, so I will have to reinstall prestashop. My version is 1.7.6.1. Will try the last one

** After much investigation I realised it was the wrong nginx configuration. What I don't understand is how is even possible that some urls / controllers worked sometimes and others didn't (either never or from time to time)

Was this page helpful?
0 / 5 - 0 ratings