chg: [module:queryModuleServer] Allow skipping trigger execution

pull/8568/head
Sami Mokaddem 2022-08-25 10:54:15 +02:00
parent 2208d01924
commit ac34456697
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 4 deletions

View File

@ -203,7 +203,7 @@ class Module extends AppModel
return "$url:$port";
}
private function __prepareAndExectureForTrigger($postData, $triggerData=[]): bool
private function __prepareAndExecuteTrigger($postData, $triggerData=[]): bool
{
$this->Workflow = ClassRegistry::init('Workflow');
$trigger_id = 'enrichment-before-query';
@ -268,10 +268,10 @@ class Module extends AppModel
* @return array|false
* @throws JsonException
*/
public function queryModuleServer(array $postData, $hover = false, $moduleFamily = 'Enrichment', $throwException = false, $triggerData=[])
public function queryModuleServer(array $postData, $hover = false, $moduleFamily = 'Enrichment', $throwException = false, $triggerData=[], $skipTrigger=false)
{
if ($moduleFamily == 'Enrichment') {
$success = $this->__prepareAndExectureForTrigger($postData, $triggerData);
if ($moduleFamily == 'Enrichment' && empty($skipTrigger)) {
$success = $this->__prepareAndExecuteTrigger($postData, $triggerData);
if (!$success) {
$trigger_id = 'enrichment-before-query';
return __('Trigger `%s` blocked enrichment', $trigger_id);