Jump to content
thirty bees forum

movieseals

Gold member
  • Posts

    451
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by movieseals

  1. I have a module that sometimes works well and sometimes crashes with a 500 error - it appears to be smarty related issues related to caches specific to some modules such as @datakick revvs module and a few others. Manually clearing the cache, ie going into the cache folder and flusing everything in both cache and compile folders sometimes brings it back to life, sometimes not. I am using PHP 7.3. As usual, any help or insight is appreciated. Here is an example of the error I get, in this case caused by a file in the cache from the crossselling module - the lines causing the issues are highlited in red: Decoded exception SplFileInfo::getSize(): stat failed for /home/zbookstore/public_html/cache/smarty/cache/crossselling/productfooter/28825 in file modules/securitybooster/securitybooster.php at line 1676 Source file: modules/securitybooster/securitybooster.php 1657: } 1658: if ((file_exists($pathTemplate)) && (file_exists($indexTemplate))) { 1659: return round(($bytestotal - filesize($indexTemplate)) / 1000, 0); 1660: } elseif ((file_exists($pathTemplate)) && (!file_exists($indexTemplate))) { 1661: return round($bytestotal / 1000, 0); 1662: } else { 1663: return $this->l('Folder is not found'); 1664: } 1665: } 1666: 1667: protected function dirSizeSmartyCache($path) 1668: { 1669: $bytestotal = 0; 1670: $path = realpath(_PS_ROOT_DIR_ . '/cache/smarty'); 1671: $index = _PS_ROOT_DIR_ . '/cache/smarty/index.php'; 1672: $index2 = _PS_ROOT_DIR_ . '/cache/smarty/compile/index.php'; 1673: $index3 = _PS_ROOT_DIR_ . '/cache/smarty/cache/index.php'; 1674: if ($path !== false) { 1675: foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object) { 1676: $bytestotal += $object->getSize(); 1677: } 1678: } 1679: return round(($bytestotal - filesize($index) - filesize($index2) - filesize($index3)) / 1000, 0); 1680: } 1681: 1682: protected function dirSizeCacheFs($path) 1683: { 1684: $bytestotal = 0; 1685: $path = realpath(_PS_ROOT_DIR_ . '/cache/cachefs'); 1686: $indexCacheFs = _PS_ROOT_DIR_ . '/cache/cachefs/index.php'; Stack trace 1. modules/securitybooster/securitybooster.php:1676 source SplFileInfo->getSize() 1657: } 1658: if ((file_exists($pathTemplate)) && (file_exists($indexTemplate))) { 1659: return round(($bytestotal - filesize($indexTemplate)) / 1000, 0); 1660: } elseif ((file_exists($pathTemplate)) && (!file_exists($indexTemplate))) { 1661: return round($bytestotal / 1000, 0); 1662: } else { 1663: return $this->l('Folder is not found'); 1664: } 1665: } 1666: 1667: protected function dirSizeSmartyCache($path) 1668: { 1669: $bytestotal = 0; 1670: $path = realpath(_PS_ROOT_DIR_ . '/cache/smarty'); 1671: $index = _PS_ROOT_DIR_ . '/cache/smarty/index.php'; 1672: $index2 = _PS_ROOT_DIR_ . '/cache/smarty/compile/index.php'; 1673: $index3 = _PS_ROOT_DIR_ . '/cache/smarty/cache/index.php'; 1674: if ($path !== false) { 1675: foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object) { 1676: $bytestotal += $object->getSize(); 1677: } 1678: } 1679: return round(($bytestotal - filesize($index) - filesize($index2) - filesize($index3)) / 1000, 0); 1680: } 1681: 1682: protected function dirSizeCacheFs($path) 1683: { 1684: $bytestotal = 0; 1685: $path = realpath(_PS_ROOT_DIR_ . '/cache/cachefs'); 1686: $indexCacheFs = _PS_ROOT_DIR_ . '/cache/cachefs/index.php'; 2. modules/securitybooster/securitybooster.php:286 source securityBooster->dirSizeSmartyCache(arguments) 267: } else 268: $conf = $this->l('Nothing that need to be cleaned'); 269: $output .= $this->displayConfirmation($conf); 270: $this->getDataBaseSize(); 271: } 272: if (((bool) Tools::isSubmit('submitCleanFullDb')) == true) { 273: self::cleanConections('connections'); 274: $this->cleanDataBase1(); 275: $this->getDataBaseSize(); 276: $output .= $this->displayConfirmation($this->l('Data base has been fully cleaned.')); 277: } 278: if (((bool) Tools::isSubmit('submitFixPermisions')) == true) { 279: $this->directoryPermisions(); 280: $output .= $this->displayConfirmation($this->l('755 permisions have been assigned to Prestashop directory.')); 281: } 282: 283: $this->context->smarty->assign('module_dir', $this->_path); 284: $this->context->smarty->assign('dirSizeTMP', $this->dirSizeTmp($path)); 285: $this->context->smarty->assign('dirSizeThemeCache', $this->dirSizeThemeCache($path)); 286: $this->context->smarty->assign('dirSizeSmartyCache', $this->dirSizeSmartyCache($path)); 287: $this->context->smarty->assign('dirSizeCacheFs', $this->dirSizeCacheFs($path)); 288: $this->context->smarty->assign('dirSizeTemplateCache', $this->dirSizeTemplateCache($path)); 289: $this->context->smarty->assign('pathTemplate', $pathTemplate); 290: $this->context->smarty->assign('dataBaseSize', Configuration::get('SECURITYBOOSTER_DATABASE_SIZE')); 291: $this->context->smarty->assign('php_info', $this->getPhpInfo()); 292: $this->context->smarty->assign('checkAbandonedCarts', $this->checkAbandonedCarts()); 293: $this->context->smarty->assign('checkConnection', $this->checkConnection()); 294: $this->context->smarty->assign('checkIntegrityDataBase', $this->checkIntegrityDataBase()); 295: $this->context->smarty->assign('folderTotalSize', (($this->dirSizeCacheFs($path) + $this->dirSizeSmartyCache($path) + $this->dirSizeTemplateCache($path) + $this->dirSizeThemeCache($path) + $this->dirSizeTmp($path)) / 1000)); 296: $this->context->smarty->assign('checkDataBase', Configuration::get('SECURITYBOOSTER_DATABASE_STATUS')); 3. controllers/admin/AdminModulesController.php:1653 source securityBooster->getContent() 1634: } 1635: } 1636: //retrocompatibility 1637: if (Tools::getValue('controller') != '') { 1638: $_POST['tab'] = Tools::safeOutput(Tools::getValue('controller')); 1639: } 1640: $echo = ''; 1641: if ($key != 'update' && $key != 'updateAll' && $key != 'checkAndUpdate' && $key != 'delete') { 1642: // We check if method of module exists 1643: if (!method_exists($module, $method)) { 1644: throw new PrestaShopException(sprintf('Method %s of module cannot be found', $method)); 1645: } 1646: if ($key == 'uninstall' && !Module::getPermissionStatic($module->id, 'uninstall')) { 1647: $this->errors[] = Tools::displayError('You do not have permission to uninstall this module.'); 1648: } 1649: if (count($this->errors)) { 1650: continue; 1651: } 1652: // Get the return value of current method 1653: $echo = $module->{$method}(); 1654: // After a successful install of a single module that has a configuration method, to the configuration page 1655: if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) { 1656: Tools::redirectAdmin(static::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12'); 1657: } 1658: } 1659: // If the method called is "configure" (getContent method), we show the html code of configure page 1660: if ($key == 'configure' && Module::isInstalled($module->name)) { 1661: $this->bootstrap = (isset($module->bootstrap) && $module->bootstrap); 1662: if (isset($module->multishop_context)) { 1663: $this->multishop_context = $module->multishop_context; 4. controllers/admin/AdminModulesController.php:1516 source AdminModulesControllerCore->postProcessCallback() 1497: if (Tools::getValue('redirect') == 'config' && Tools::getValue('module_name') != '' && Module::isInstalled(pSQL(Tools::getValue('module_name')))) { 1498: Tools::redirectAdmin('index.php?controller=adminmodules&configure='.Tools::getValue('module_name').'&token='.Tools::getValue('token').'&module_name='.Tools::getValue('module_name')); 1499: } 1500: 1501: // Execute filter or callback methods 1502: $filterMethods = ['filterModules', 'resetFilterModules', 'filterCategory', 'unfilterCategory']; 1503: $callbackMethods = ['reset', 'download', 'enable', 'delete', 'enable_device', 'disable_device']; 1504: $postProcessMethodsList = array_merge((array) $filterMethods, (array) $callbackMethods); 1505: foreach ($postProcessMethodsList as $ppm) { 1506: if (Tools::isSubmit($ppm)) { 1507: $ppm = 'postProcess'.ucfirst($ppm); 1508: if (method_exists($this, $ppm)) { 1509: $ppmReturn = $this->$ppm(); 1510: } 1511: } 1512: } 1513: 1514: // Call appropriate module callback 1515: if (!isset($ppmReturn)) { 1516: $this->postProcessCallback(); 1517: } 1518: 1519: if ($back = Tools::getValue('back')) { 1520: Tools::redirectAdmin($back); 1521: } 1522: } 1523: 1524: /** 1525: * @return void 1526: * 5. override/controllers/admin/AdminModulesController.php:22 source AdminModulesControllerCore->postProcess() 3: * Ce module permet de raccourcir les urls catégorie et page cms et catégorie de produit et produit 4: * 5: * @author Pliciweb Solutions<[email protected]> 6: * @copyright 2007-2015 PrestaShop SA 7: * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 8: */ 9:class AdminModulesController extends AdminModulesControllerCore 10:{ 11: /** 12: * permet de lancer un build a la page du module 13: * pour recréer la chaine 14: */ 15: /* 16: * module: plicimultioverride 17: * date: 2020-02-04 09:43:33 18: * version: 1.0.7 19: */ 20: public function postProcess() 21: { 22: $return = parent::postProcess(); 23: $module = Module::getInstanceByName('plicimultioverride'); 24: $module->multiOvrBuildAll(); 25: return $return; 26: } 27:} 6. classes/controller/Controller.php:197 source AdminModulesController->postProcess() 178: } else { 179: $this->$property = $value; 180: } 181: } 182: 183: /** 184: * Starts the controller process 185: * 186: * @since 1.0.0 187: * @version 1.0.0 Initial version 188: */ 189: public function run() 190: { 191: $this->init(); 192: if ($this->checkAccess()) { 193: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 194: $this->setMedia(); 195: } 196: 197: $this->postProcess(); 198: 199: if (!empty($this->redirect_after)) { 200: $this->redirect(); 201: } 202: 203: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 204: $this->initHeader(); 205: } 206: 207: if ($this->viewAccess()) { 7. classes/Dispatcher.php:852 source ControllerCore->run() 833: return; 834: } 835: break; 836: 837: default: 838: throw new PrestaShopException('Bad front controller chosen'); 839: } 840: 841: // Instantiate controller 842: try { 843: // Loading controller 844: $controller = Controller::getController($controllerClass); 845: 846: // Execute hook dispatcher 847: if (isset($paramsHookActionDispatcher)) { 848: Hook::exec('actionDispatcher', $paramsHookActionDispatcher); 849: } 850: 851: // Running controller 852: $controller->run(); 853: } catch (PrestaShopException $e) { 854: $e->displayMessage(); 855: } 856: } 857: 858: /** 859: * Retrieve the controller from url or request uri if routes are activated 860: * 861: * @param int|null $idShop 862: * 8. smtgitb9e0nbr7r0/index.php:63 source DispatcherCore->dispatch() 44://small test to clear cache after upgrade 45:if (Configuration::get('PS_UPGRADE_CLEAR_CACHE')) { 46: header('Cache-Control: max-age=0, must-revalidate'); 47: header('Expires: Mon, 06 Jun 1985 06:06:00 GMT+1'); 48: Configuration::updateValue('PS_UPGRADE_CLEAR_CACHE', 0); 49:} 50: 51:// For retrocompatibility with "tab" parameter 52:if (!isset($_GET['controller']) && isset($_GET['tab'])) { 53: $_GET['controller'] = strtolower($_GET['tab']); 54:} 55:if (!isset($_POST['controller']) && isset($_POST['tab'])) { 56: $_POST['controller'] = strtolower($_POST['tab']); 57:} 58:if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) { 59: $_REQUEST['controller'] = strtolower($_REQUEST['tab']); 60:} 61: 62:// Prepare and trigger admin dispatcher 63:Dispatcher::getInstance()->dispatch();
  2. Thank you so much! UPDATE: Worked like a charm! Thanks again!
  3. I would normally use the TB Stripe module but I need a subscription function for the magazines we sell. I have a Stripe module that enables that but since switching to PHP 7.3, I get the following error in my php error log: count(): Parameter must be an array or an object that implements Countable in /home/zbookstore/public_html/modules/stripepro/stripepro.php on line 410 Here is the code on and around line 410, where line 410 is in red: /** * [hookHeader => change add to cart button with subscribe button on home page as well as on product page] * @param [type] $params [array containing information of the product] * @return [type] [description] */ public function hookHeader($params) { if (Tools::getValue('controller') == 'product') { $product_id = Tools::getValue('id_product'); if(!empty($product_id)) { $sub = Db::getInstance()->getValue('select `id_subscription_product` from `'._DB_PREFIX_.'stripepro_products` where `active` = 1 && `id_product_attribute`=0 && `id_product`= '.$product_id); if($sub != '') { $this->context->smarty->assign('controller','product'); return $this->display(__FILE__, 'subscribe.tpl'); } } } else { /* Continue only if we are in the checkout process */ if (Tools::getValue('controller') != 'order-opc' && (!($_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order.php' || $_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order-opc.php' || Tools::getValue('controller') == 'order' || Tools::getValue('controller') == 'orderopc' || Tools::getValue('step') == 3 || Tools::getValue('controller') == 'supercheckout' || Tools::getValue('pm') == 'stripepro'))){ $subscribe_products = Db::getInstance()->executeS('select * from `'._DB_PREFIX_.'stripepro_products` where `active`= 1 && `id_product_attribute`=0 '); if (count($subscribe_products > 0)) { $this->context->smarty->assign('subscriptions',$subscribe_products); return $this->display(__FILE__, 'subscribe.tpl'); } } else { $nbProducts = $this->context->cart->nbProducts(); if ($nbProducts<=0) return; $this->smarty->assign($this->getPaymentVars()); $this->context->controller->addCSS($this->_path.'views/css/stripe-prestashop.css'); $this->context->controller->addJS("https://js.stripe.com/v2/"); $this->context->controller->addJS("https://js.stripe.com/v3/"); if(Configuration::get('STRIPE_CHKOUT_POPUP') || Configuration::get('STRIPE_ALLOW_BTC')) $this->context->controller->addJS("https://checkout.stripe.com/checkout.js"); return $this->display(__FILE__, './views/templates/front/vars_payment.tpl'); } } } public function checkCurrency($cart) { $currency_order = new Currency($cart->id_currency); $currencies_module = $this->getCurrency($cart->id_currency); if (is_array($currencies_module)) { foreach ($currencies_module as $currency_module) { if ($currency_order->id == $currency_module['id_currency']) { return true; } } } return false; } Any insights on how to fix this would be very appreciated. Thanks!
  4. I will try with all but TB modules disabled to try and pinpoint if it is a module. Thanks.
  5. Hi! I am having an issue right now with the sitemap module. Whenever I try to generate a sitemap, either by cronjob or manually, the module times out after roughly 20 seconds. I checked the php ini, I have plenty of memory, max execution time is pretty high, and most other long scripts usually run fine on the site so I am at a loss as to why this is happening with this particular module.
  6. Hello all, I get an error 500 and the following exception when I click on customers in the customers section with TB 1.1.x Decoded exception Too few arguments to function okom_vip::printForm(), 2 passed in /home/zbookstore/public_html/modules/okom_vip/okom_vip.php on line 454 and exactly 3 expected in file modules/okom_vip/okom_vip.php at line 492 Source file: modules/okom_vip/okom_vip.php 473: $exprired = false; 474: } else { 475: $exprired = true; 476: } 477: } 478: 479: $product = new Product((int)Configuration::get('OKOM_VIP_IDPRODUCT'), true, $this->context->language->id); 480: $link = new Link(); 481: //@TODO Fix Bad Link 482: $vip_product_url = $link->getProductLink($product); 483: $this->context->smarty->assign(array( 484: 'customer_vip' => $customer_vip, 485: 'exprired' => $exprired, 486: 'is_vip' => $is_vip, 487: 'vip_product_url' => $vip_product_url 488: )); 489: return $this->display(__FILE__, 'shopping-cart.tpl'); 490: } 491: 492: public function printForm($vip_add, $vip_end, $vip_cards) 493: { 494: $option = ''; 495: 496: if ($vip_cards) { 497: foreach ($vip_cards as $vip_card) { 498: $option .= '<option data-add="'.$vip_card['vip_add'].'" data-end="'.$vip_card['vip_end'].'" value="'.$vip_card['id_vip'].'">'.$vip_card['id_vip'].' : '.$vip_card['vip_add'].' to '.$vip_card['vip_end'].'</option>'; 499: } 500: } 501: 502: $html = '';
  7. I could not make it work - I tried for weeks. I eventually found a module called elastic search connector on Prestashop and with a bit of help from the dev managed to get it working under php 7.3 with the latest version (7) of elastic search but part of the module does not work, mostly the logging, but the search part works wonderfully.
  8. What do you mean, it does not work? What version of the module do you have? Version 1.3.1 works fine with 1.1, at least for me. Perhaps revisit the module if you have the same version as I do: there is a slider that needs to be put to on now in order for imagick to be activated. Other than that, everything works fine.
  9. Hello everyone, I have a module that hide the TB Block Currency module and shows the currency according to the IP or country of visitor. The hiding works fine on every and all pages that are actually from the theme itself. However, whenever a user goes to theme pages generated by a module (blog, a module for events, etc), then the block currency reverts to showing a selector with all the currencies available. Does anyone know why the module pages would not be affected - the code appears to be similar, the only thing changing is the nature of the links. I would like to achieve the same effect on every pages, native or modules, for consistency sake. Thank you!
  10. Hello everyone, I am encountering a weird pagination issue on some pages when there is a lot of products. The first and second pages repeat themselves, meaning clicking on page 1 or page 2 shows the exact same products. To actually get on to the products on page 2, you need to click on page 3 and so on. So basically, on some pages, an extra page with the exact same content is generated. Anyone else experiencing this? I believe it is an artefact created by the way pages are counted and when you reach a certain amount of pages, it just breaks. If anyone as a clue as to how I could go about fixing this - it is very weird.
  11. I speak for myself but I can already see the results of that work. Even on Ps 1.6, I used to have all kinds of problems and more often, they were due to bugs or other code issues - things have been night and day even from the early versions of TB up to now - I can see that each bugs that get fixed even help some modules that never worked properly from before. So I am totally down and good with that approach. When the base is stable, it will be easier to build on it.
  12. I did test all my old PS modules with TB. Some no longer work, usually due to outdated programming or aggressive overrides. 95% work as intended. It takes time. I understand wanting a turnkey solution that roars right off the bat. The basic TB works fine for a lot of needs. All I can say is that I spend less time fighting stupid bugs than when I was on the PS platform. That being said, fingers crossed for Lesley. I hope things go well and you are back on your feet soon.
  13. Well, the problem is back again. Still do not know what is causing it but got more useful info in some logs: HP Fatal error: Uncaught Error: Class 'Shop' not found in /home/zbookstore/public_html/classes/Configuration.php:376 Stack trace: #0 /home/zbookstore/public_html/classes/Tools.php(5259): ConfigurationCore::get('PS_TIMEZONE') #1 /home/zbookstore/public_html/classes/db/Db.php(274): ToolsCore::getTimeZone() #2 /home/zbookstore/public_html/classes/Configuration.php(405): DbCore::getInstance(0) #3 /home/zbookstore/public_html/classes/Configuration.php(371): ConfigurationCore::loadConfiguration() #4 /home/zbookstore/public_html/classes/Encryptor.php(135): ConfigurationCore::get('PS_CIPHER_ALGOR...') #5 /home/zbookstore/public_html/classes/Encryptor.php(60): EncryptorCore::getCipherTool() #6 /home/zbookstore/public_html/classes/exception/PrestaShopException.php(98): EncryptorCore::getInstance() #7 /home/zbookstore/public_html/classes/ErrorHandler.php(132): PrestaShopExceptionCore->displayMessage() #8 [internal function]: ErrorHandlerCore->uncaughtExceptionHandler(Object(Error)) #9 {main} thrown in /home/zbookstore/public_html/classes/Configuration.php on line 376
  14. Thank you everybody for the help.
  15. Ah! I see... 😞 I removed all the modules that were not TB and I reinstalled them one by one. Seemed to have worked for now.
  16. If I was able to login in the backend, I would have done it - I know where it is. It's just that when you cannot login in the backend, you are kind of screwed...
  17. Only message in logs are these: Declaration of Link_000_webpgenerator::getImageLink($name, $ids, $type = NULL) should be compatible with LinkCore::getImageLink($name, $ids, $type = NULL, $format = 'jpg', $highDpi = false) in /home/zbookstore/public_html/override_multi/classes/Link_000_webpgenerator.php on line 0 Declaration of Link_000_webpgenerator::getCatImageLink($name, $idCategory, $type = NULL) should be compatible with LinkCore::getCatImageLink($name, $idCategory, $type = NULL, $format = 'jpg', $highDpi = false) in /home/zbookstore/public_html/override_multi/classes/Link_000_webpgenerator.php on line 0 and Undefined index: HTTP_USER_AGENT in /home/zbookstore/public_html/modules/ets_superspeed/classes/cache.php on line 31 They look harmless for the most part. Removing the modules and associated files does not fix the problem so I think those are unrelated. Unable to run the exception I download through the decoder, so I am at a loss as to what is causing this. Everything was working fine. Deleting htaccess does not work. Rebooting server neither. I have tried disabling the overrides folders, to no effect. I also manually emptied all caches in case it was caused by a cache corruption. No dice. I have attached my exception, if someone could kindly decode it and copy the results, it might give me an inkling of what is wrong. exception_2019121519436.txt
  18. I am also on PHP 7.3.12 and no issues whatsoever on that front.
  19. Who cares if it is late a few weeks? It is a small, dedicated team. I would rather it be late than buggy. Worst comes to worst, you can always painlessly experiment with the 1.1.x version. We are getting more than I ever got under the old model. I can be patient. I would rather have something that works than a mountain of hidden bugs like we used to get... The team here has its heart in the right place. They are responsible and meticulous. I am willing to be patient. They will let us know when they are ready for prime time.
  20. Hi again! I ran the module today and everything checked out except for one thing. It said that there was one image missing. It gave me the product ID. I regenerated this image and re-ran the tests. Still got the error. So I click on the fix button in the module and ran the tests again - this time everything is A-OK. Just for my understanding, what does the module do that the regeneration of the product images did not?
  21. Is it me or the Informations.tpl code is missing to make this work?
  22. It's true that I was running PS under 5.6 at the time... Thanks for the pointer.
  23. Hello all. I am having an issue with a module that used to work under 1.6.1. When I install the module, it gives a 500 error. The details of the error is below. It seems to cascade through quite a bit. Not sure if it is fixable or not. Any advice would be appreciated. Developper does not want to do anything because it is TB. What the module does is help manage tags and unify them across languages. Here is the initial error that cause the 500 error call - if you go back, though, the module is installed and seems to work but it no longer imports the existing tags in the main language. Decoded exception Too few arguments to function Tagm::insertTagM(), 0 passed in /home/zbookstore/public_html/modules/patagsmanagement/classes/Tagm.php on line 384 and exactly 1 expected in file modules/patagsmanagement/classes/Tagm.php at line 476 If you open up all the stack traces, this is what we get: Source file: modules/patagsmanagement/classes/Tagm.php 457: 458: if (Db::getInstance()->execute($q)) { 459: //elimino los names de tags 460: $q = "DELETE FROM `"._DB_PREFIX_."tag` WHERE name in('".$strTagsComplete."')"; 461: Db::getInstance()->execute($q); 462: $q = "DELETE FROM `"._DB_PREFIX_."tagm` WHERE id_tagm = ".(int)$idtagm; 463: Db::getInstance()->execute($q); 464: //elimino de las relaciones de agrupacion 465: return true; 466: } 467: return false; 468: } 469: 470: public static function updateTagM($idtagm, $public) 471: { 472: $q = 'UPDATE `'._DB_PREFIX_.'tagm` set public = '.(int)$public.' WHERE id_tagm ='.(int)$idtagm; 473: Db::getInstance()->execute($q); 474: } 475: 476: public static function insertTagM($public) 477: { 478: $q = 'INSERT INTO `'._DB_PREFIX_.'tagm` (fecha,public) VALUES (now(),'.(int)$public.')'; 479: 480: if (Db::getInstance()->execute($q)) { 481: return Db::getInstance()->Insert_ID(); 482: } 483: 484: return null; 485: } 486:} Stack trace 1. modules/patagsmanagement/classes/Tagm.php:384 source Tagm::insertTagM() 365: 366: return $saveOk; 367: } 368: 369: public static function createTagForLang() 370: { 371: $sql = 'SELECT id_lang , count(*) as cant from '._DB_PREFIX_ 372: .'tag GROUP BY id_lang ORDER BY cant DESC LIMIT 0,1'; 373: $tagsConteo = Db::getInstance()->executeS($sql); 374: 375: if (isset($tagsConteo) && $tagsConteo[0]) { 376: $lang_id_tags = $tagsConteo[0]['id_lang']; 377: 378: if ($tagsConteo[0]['cant']>0) { 379: //creo todos los tags para ese idioma 380: $sql = 'SELECT * from '._DB_PREFIX_.'tag WHERE id_lang = '.(int)$lang_id_tags; 381: $tagsAdd = Db::getInstance()->executeS($sql); 382: 383: foreach ($tagsAdd as $t) { 384: $id_tagm = Tagm::insertTagM(); 385: 386: $dataTagmTag = array(); 387: $dataTagmTag['id_tagm'] = $id_tagm; 388: $dataTagmTag['id_tag'] = $t['name']; 389: $dataTagmTag['id_lang'] = $t['id_lang']; 390: 391: Tagm::insertTagmTag($dataTagmTag); 392: } 393: } 394: } 2. modules/patagsmanagement/patagsmanagement.php:69 source Tagm::createTagForLang() 50: } 51: 52: // Execute module install SQL statements 53: $sql_file = dirname(__FILE__).'/install/install.sql'; 54: if (!$this->loadSQLFile($sql_file)) { 55: return false; 56: } 57: 58: // Install admin tab 59: $langnames = array(); 60: $langnames['es'] = 'Gestión avanzada de etiquetas'; 61: $langnames['fr'] = 'Gestion avancée et affichage'; 62: $langnames['en'] = 'Advanced Tags Management'; 63: 64: if (!$this->installTab('AdminCatalog', 'AdminPATagsManagement', 'Advanced Tags Management', $langnames)) { 65: return false; 66: } 67: 68: //tomo los tags existentes en el idioma que mas tenga 69: Tagm::createTagForLang(); 70: 71: // Register hooks 72: if (!$this->registerHook('displayRightColumnProduct') 73: ) { 74: return false; 75: } 76: 77: //Create the folder for imgs 78: $dir = _PS_ROOT_DIR_.'/img/tagm'; 79: mkdir($dir, 0777, true); 3. controllers/admin/AdminModulesController.php:1653 source PATagsManagement->install() 1634: } 1635: } 1636: //retrocompatibility 1637: if (Tools::getValue('controller') != '') { 1638: $_POST['tab'] = Tools::safeOutput(Tools::getValue('controller')); 1639: } 1640: $echo = ''; 1641: if ($key != 'update' && $key != 'updateAll' && $key != 'checkAndUpdate' && $key != 'delete') { 1642: // We check if method of module exists 1643: if (!method_exists($module, $method)) { 1644: throw new PrestaShopException(sprintf('Method %s of module cannot be found', $method)); 1645: } 1646: if ($key == 'uninstall' && !Module::getPermissionStatic($module->id, 'uninstall')) { 1647: $this->errors[] = Tools::displayError('You do not have permission to uninstall this module.'); 1648: } 1649: if (count($this->errors)) { 1650: continue; 1651: } 1652: // Get the return value of current method 1653: $echo = $module->{$method}(); 1654: // After a successful install of a single module that has a configuration method, to the configuration page 1655: if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) { 1656: Tools::redirectAdmin(static::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12'); 1657: } 1658: } 1659: // If the method called is "configure" (getContent method), we show the html code of configure page 1660: if ($key == 'configure' && Module::isInstalled($module->name)) { 1661: $this->bootstrap = (isset($module->bootstrap) && $module->bootstrap); 1662: if (isset($module->multishop_context)) { 1663: $this->multishop_context = $module->multishop_context; 4. controllers/admin/AdminModulesController.php:1516 source AdminModulesControllerCore->postProcessCallback() 1497: if (Tools::getValue('redirect') == 'config' && Tools::getValue('module_name') != '' && Module::isInstalled(pSQL(Tools::getValue('module_name')))) { 1498: Tools::redirectAdmin('index.php?controller=adminmodules&configure='.Tools::getValue('module_name').'&token='.Tools::getValue('token').'&module_name='.Tools::getValue('module_name')); 1499: } 1500: 1501: // Execute filter or callback methods 1502: $filterMethods = ['filterModules', 'resetFilterModules', 'filterCategory', 'unfilterCategory']; 1503: $callbackMethods = ['reset', 'download', 'enable', 'delete', 'enable_device', 'disable_device']; 1504: $postProcessMethodsList = array_merge((array) $filterMethods, (array) $callbackMethods); 1505: foreach ($postProcessMethodsList as $ppm) { 1506: if (Tools::isSubmit($ppm)) { 1507: $ppm = 'postProcess'.ucfirst($ppm); 1508: if (method_exists($this, $ppm)) { 1509: $ppmReturn = $this->$ppm(); 1510: } 1511: } 1512: } 1513: 1514: // Call appropriate module callback 1515: if (!isset($ppmReturn)) { 1516: $this->postProcessCallback(); 1517: } 1518: 1519: if ($back = Tools::getValue('back')) { 1520: Tools::redirectAdmin($back); 1521: } 1522: } 1523: 1524: /** 1525: * @return void 1526: * 5. override/controllers/admin/AdminModulesController.php:22 source AdminModulesControllerCore->postProcess() 3: * Ce module permet de raccourcir les urls catégorie et page cms et catégorie de produit et produit 4: * 5: * @author Pliciweb Solutions<[email protected]> 6: * @copyright 2007-2015 PrestaShop SA 7: * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 8: */ 9:class AdminModulesController extends AdminModulesControllerCore 10:{ 11: /** 12: * permet de lancer un build a la page du module 13: * pour recréer la chaine 14: */ 15: /* 16: * module: plicimultioverride 17: * date: 2019-08-09 14:02:59 18: * version: 1.0.7 19: */ 20: public function postProcess() 21: { 22: $return = parent::postProcess(); 23: $module = Module::getInstanceByName('plicimultioverride'); 24: $module->multiOvrBuildAll(); 25: return $return; 26: } 27:} 6. classes/controller/Controller.php:197 source AdminModulesController->postProcess() 178: } else { 179: $this->$property = $value; 180: } 181: } 182: 183: /** 184: * Starts the controller process 185: * 186: * @since 1.0.0 187: * @version 1.0.0 Initial version 188: */ 189: public function run() 190: { 191: $this->init(); 192: if ($this->checkAccess()) { 193: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 194: $this->setMedia(); 195: } 196: 197: $this->postProcess(); 198: 199: if (!empty($this->redirect_after)) { 200: $this->redirect(); 201: } 202: 203: if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 204: $this->initHeader(); 205: } 206: 207: if ($this->viewAccess()) { 7. classes/Dispatcher.php:852 source ControllerCore->run() 833: return; 834: } 835: break; 836: 837: default: 838: throw new PrestaShopException('Bad front controller chosen'); 839: } 840: 841: // Instantiate controller 842: try { 843: // Loading controller 844: $controller = Controller::getController($controllerClass); 845: 846: // Execute hook dispatcher 847: if (isset($paramsHookActionDispatcher)) { 848: Hook::exec('actionDispatcher', $paramsHookActionDispatcher); 849: } 850: 851: // Running controller 852: $controller->run(); 853: } catch (PrestaShopException $e) { 854: $e->displayMessage(); 855: } 856: } 857: 858: /** 859: * Retrieve the controller from url or request uri if routes are activated 860: * 861: * @param int|null $idShop 862: * 8. override/classes/Dispatcher.php:36 source DispatcherCore->dispatch() 17: * @author ETS-Soft <[email protected]> 18: * @copyright 2007-2019 ETS-Soft 19: * @license Valid for 1 website (or project) for each purchase of license 20: * International Registered Trademark & Property of ETS-Soft 21: */ 22:class Dispatcher extends DispatcherCore 23:{ 24: /* 25: * module: ets_superspeed 26: * date: 2019-11-26 19:36:05 27: * version: 1.0.8 28: */ 29: public function dispatch() { 30: require_once(dirname(__FILE__).'/../../modules/ets_superspeed/ets_superspeed.php'); 31: if($cache = Ets_superspeed::displayContentCache(true)) 32: { 33: echo $cache; 34: return true; 35: } 36: parent::dispatch(); 37: } 38:} 9. smtgitb9e0nbr7r0/index.php:63 source Dispatcher->dispatch() 44://small test to clear cache after upgrade 45:if (Configuration::get('PS_UPGRADE_CLEAR_CACHE')) { 46: header('Cache-Control: max-age=0, must-revalidate'); 47: header('Expires: Mon, 06 Jun 1985 06:06:00 GMT+1'); 48: Configuration::updateValue('PS_UPGRADE_CLEAR_CACHE', 0); 49:} 50: 51:// For retrocompatibility with "tab" parameter 52:if (!isset($_GET['controller']) && isset($_GET['tab'])) { 53: $_GET['controller'] = strtolower($_GET['tab']); 54:} 55:if (!isset($_POST['controller']) && isset($_POST['tab'])) { 56: $_POST['controller'] = strtolower($_POST['tab']); 57:} 58:if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) { 59: $_REQUEST['controller'] = strtolower($_REQUEST['tab']); 60:} 61: 62:// Prepare and trigger admin dispatcher 63:Dispatcher::getInstance()->dispatch(); If it can be fixed by myself, I am open to any and all suggestions. If it is a more complicated matter, I am willing to pay someone to help me fix it.
  24. OK, I am not entirely familiar with Panda but you can punch holes in the LSCache to allow modules that require no caching, such as login, wishlist, carts, etc. Perhaps it does not work with the way the theme is designed but if you flag those modules as private, they will not get cached normally.
  25. I solved the issue by using the core updater, going back one iteration then reinstalling my current one again - everything came back! Not too sure why but I will take the end result! I wish I could explain what went wrong beyond the scrambling of the htaccess because since it is automatically generated, it should have been overwritten and reverted back to before. Anyhow, I leave my solution here in case someone else encounters a similar problem.
×
×
  • Create New...