Jump to content

(1/1) FatalThrowableError Undefined constant "_PS_THEME_MOBILE_DIR_" in Context.php line 292


Webdome

Recommended Posts

Hey all,

on one of my clients prestashop following error occurs:


"(1/1) FatalThrowableError

Undefined constant "_PS_THEME_MOBILE_DIR_"

in Context.php line 292"

 

We don't know, how to solve this. Any ideas for this problem?

 

While log in to the admin of this page, we got following error:

"(1/1) FatalErrorException

Compile Error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false

in PDOConnection.php line 70"

 

The current php version is 7.4

 

Thanks for all your help.

Link to comment
Share on other sites

Posted (edited)

Just go to phpmyadmin and in the xx_configuration table add that record. It should fix the "error" although you can also "disable" it by changing the value of "PS_ALLOW_MOBILE_DEVICE" in that same table and setting it to 0 (not sure where/if it is configurable from the BO - probably under the theme settings).

From the Context class:
 

return isset($_SERVER['HTTP_USER_AGENT'], Context::getContext()->cookie)
            && (bool) Configuration::get('PS_ALLOW_MOBILE_DEVICE')
            && defined('_PS_THEME_MOBILE_DIR_')
            && @filemtime(_PS_THEME_MOBILE_DIR_)
            && !Context::getContext()->cookie->no_mobile;

As I understand it, you would only enable this if you have a specific, separate mobile theme.

Edited by Paul C
expanded answer (see edit history)
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...