c_reiter Posted August 31, 2017 Share Posted August 31, 2017 Hi, I'm trying to dig into some problems with an existing PrestaShop setup, I've been approached by the site owners after their original developer did a disappearing act. They have some problems with recurring 500 errors that turn out, after activating _PS_MODE_DEV_, to be caused by database operations such as CREATE TEMPORARY TABLE ps_cat_restriction ENGINE=MEMORY. The database user in the hosting environment doesn't have CREATE TEMPORARY TABLE privileges and the privilege can't be granted. Is creating temporary tables a baseline requirement for running Prestashop? That is, the database has to be moved to a server where that priviliege is available? The code doing that is in classes/Product.php and modules/blocklayered/blocklayered.php so it's not a third party extension doing that. Thanks for any help, Christian Link to comment Share on other sites More sharing options...
Scully Posted September 1, 2017 Share Posted September 1, 2017 This is how prestashop works. In Product.php it is the function getRandomSpecial which needs the CREATE privilege. However you could easily disclaim this function. It's not important at all. Dirty fix: public static function getRandomSpecial($id_lang, $beginning = false, $ending = false, Context $context = null) { return false; } Or you can rewrite the function with - as example - writing to a temporary file. Takes more time than a memory table but would work. Or you can create a non-temporary normal table with the characteristics according to the class. Then replace .... Db::getInstance()->execute('CREATE TEMPORARY TABLE `'._DB_PREFIX_.'product_reductions` (id_product INT UNSIGNED NOT NULL DEFAULT 0, id_product_attribute INT UNSIGNED NOT NULL DEFAULT 0) ENGINE=MEMORY', false); with Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_reductions ;`); Same for blocklayered. It won't get faster with a rewrite but there are many options. 1 Link to comment Share on other sites More sharing options...
c_reiter Posted September 6, 2017 Author Share Posted September 6, 2017 Thanks, I'll have a look at rewriting it. Link to comment Share on other sites More sharing options...
Kevin Posted November 16, 2017 Share Posted November 16, 2017 @c_reiter I have the same problem as you. Can you tell me how do you fix the problem? many thanks Link to comment Share on other sites More sharing options...
bellini13 Posted November 16, 2017 Share Posted November 16, 2017 Scully already did, did you try to read? Link to comment Share on other sites More sharing options...
Kevin Posted November 21, 2017 Share Posted November 21, 2017 @ bellini13 I have tried to rewrite the getRandomSpecial function, but my problem still there. I also checked app/config/parameters.php, all the information is correct with my host provider. It seems like when I create a new product, the new product can be displayed at my home page, but it is not displayed under its associated catalog page Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now