Jump to content

Geo3010

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Activity
    Freelancer

Geo3010's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I need to temporary disable the cache for the time needed for a script to run. At the moment I just manually disable the cache via admin pannel -> Advanced parameters -> Performance: Use cache yes/no, before to run the script and then reenable it when it's done. I want to automate this disabling the cache at the beginning of the script and reenabling it at the end. (the script must run in cron) I've tried something I've found in AdminPerformanceController: /* DISABLE CACHE */ $prev_settings = file_get_contents(_PS_ROOT_DIR_.'/config/settings.inc.php'); $new_settings = $prev_settings; $cache_active = 0; // 1 to enable $new_settings = preg_replace('/define\(\'_PS_CACHE_ENABLED_\', \'([01]?)\'\);/Ui', 'define(\'_PS_CACHE_ENABLED_\', \''.(int)$cache_active.'\');', $new_settings); if(copy(_PS_ROOT_DIR_.'/config/settings.inc.php', _PS_ROOT_DIR_.'/config/settings.old.php') && (bool)file_put_contents(_PS_ROOT_DIR_.'/config/settings.inc.php', $new_settings)) { error_log("Cache disabled"); } else { error_log("Seems that the settings file cannot be overwritten"); exit; } But it's not enough, I think it's missing some kind of settings reload action or similar... Any idea?
  2. Ho la necessità di disabilitare la cache durante l'esecuzione di uno script php (esterno al sistema ps). Al momento, la disabilito manualmente via il pannello admin -> Advanced parameters -> Performance: Use cache si/no, prima dell'esecuzione dello script e la riabilito dopo. Vorrei automatizzare questa procedura disabilitando la cache all'inizio dello script e riabilitandola alla fine dello stesso script. Ho provato con una azione simile a quanto trovato nell'AdminPerformanceController: /* DISABLE CACHE */ $prev_settings = file_get_contents(_PS_ROOT_DIR_.'/config/settings.inc.php'); $new_settings = $prev_settings; $cache_active = 0; // 1 per riabilitare $new_settings = preg_replace('/define\(\'_PS_CACHE_ENABLED_\', \'([01]?)\'\);/Ui', 'define(\'_PS_CACHE_ENABLED_\', \''.(int)$cache_active.'\');', $new_settings); if(copy(_PS_ROOT_DIR_.'/config/settings.inc.php', _PS_ROOT_DIR_.'/config/settings.old.php') && (bool)file_put_contents(_PS_ROOT_DIR_.'/config/settings.inc.php', $new_settings)) { error_log("Cache disabled"); } else { error_log("Seems that the settings file cannot be overwritten"); exit; } Però manca qualcosa tipo un reload delle impostazioni... Qualcuno ha un'idea?
  3. I'm having the same issue on ps 1.6.0.8. Did you solve it in some way? Regards
  4. Workaround: {if $t.sub_tabs|@count && reset($t.sub_tabs)} {assign var="first_k" value=key($t.sub_tabs)} {/if} <a href="{if $t.sub_tabs|@count && isset($t.sub_tabs[$first_k].href)}{$t.sub_tabs[$first_k].href}{else}{$t.href}{/if}" class="title" > <i class="icon-{$t.class_name}"></i> <span>{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</span> </a>
  5. In fact, the trouble comes from this link: <a href="{if $t.sub_tabs|@count && isset($t.sub_tabs[0].href)}{$t.sub_tabs[0].href}{else}{$t.href}{/if}" class="title" > <i class="icon-{$t.class_name}"></i> <span>{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</span> </a> inside admin/themes/default/template/nav.tpl And in particular: $t.sub_tabs[0]
  6. The BO menu is made of main pages, or tabs, (like "Preferences") which can contain a sub menu of sub tabs (like "General", "Orders", "Products", ...). It seems that when you click on the parent tab, the action focuses on its first sub tab. Now if I create a profile not allowed to access the first sub tab of a menu tab, when an employee with such profile clicks on the parent menu tab, the system raises an "Access denied" error. It seems that the error raises simply because the parent does not focus on its first ACCESSIBLE sub tab but stubbornly on its first sub tab, accessible or not! Can it be? Is there a way to set the "parent" focus? Thank you.
  7. Thank you. Finally it was a bug (#PSCSX-1257)! Solution can be found following the last Jérôme Nadaud's comment on http://forge.prestashop.com/browse/PSCSX-1257?focusedCommentId=93842&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-93842 Of course, such bug is corrected in the new PS 1.6.0.9 version as well.
  8. I've changed some files and "AdminProductsController.php". Have you any tips about this?
×
×
  • Create New...