Fixed bugs switching Debug mode and WebJobs from the settings page

This commit is contained in:
max-baranikov 2022-02-04 12:06:35 +03:00 committed by GitHub
parent 5b9b6a7a99
commit 2bdf1cc4de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -455,7 +455,9 @@ class RetailcrmTools
*/
public static function isDebug()
{
return '1' === Configuration::get(RetailCRM::ENABLE_DEBUG_MODE);
$value = Configuration::get(RetailCRM::ENABLE_DEBUG_MODE);
return '1' === $value || true === $value;
}
/**
@ -489,6 +491,11 @@ class RetailcrmTools
return null;
}
/**
* WebJobs should be enabled by default, so here we check if it was explicitly disabled
*
* @return bool
*/
public static function isWebJobsEnabled()
{
return '0' !== Configuration::get(RetailCRM::ENABLE_WEB_JOBS);

View File

@ -971,7 +971,7 @@ class RetailCRM extends Module
'enableOrderNumberSending' => (false !== Tools::getValue(static::ENABLE_ORDER_NUMBER_SENDING)),
'enableOrderNumberReceiving' => (false !== Tools::getValue(static::ENABLE_ORDER_NUMBER_RECEIVING)),
'debugMode' => (false !== Tools::getValue(static::ENABLE_DEBUG_MODE)),
'webJobs' => (false !== Tools::getValue(static::ENABLE_WEB_JOBS, true) ? '1' : '0'),
'webJobs' => (false !== Tools::getValue(static::ENABLE_WEB_JOBS) ? '1' : '0'),
'collectorActive' => (false !== Tools::getValue(static::COLLECTOR_ACTIVE)),
'collectorKey' => (string) (Tools::getValue(static::COLLECTOR_KEY)),
'clientId' => Configuration::get(static::CLIENT_ID),