-
Notifications
You must be signed in to change notification settings - Fork 1
Bump version v2.7.12 #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump version v2.7.12 #137
Changes from all commits
5d7c9a3
83a8e1a
5653bd2
b6f1dbf
2489957
b2bd09a
985f200
798e34e
6062ac4
846b4b0
b9abad9
1a811c3
16b760f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,8 @@ | |
|
|
||
| use BitApps\Integrations\Config; | ||
| use BitApps\Integrations\Core\Util\Common; | ||
| use BitApps\Integrations\Core\Util\HttpHelper; | ||
| use BitApps\Integrations\Core\Util\Hooks; | ||
| use BitApps\Integrations\Core\Util\HttpHelper; | ||
| use BitApps\Integrations\Log\LogHandler; | ||
| use DateTime; | ||
| use DateTimeImmutable; | ||
|
|
@@ -178,7 +178,7 @@ public function execute($integrationDetails, $fieldValues, $fieldMap, $actions) | |
| $finalData = $this->generateReqDataFromFieldMap($fieldValues, $fieldMap); | ||
| $response = $this->insertContact($finalData, $update); | ||
|
|
||
| $responseType = !\is_null($response) || (\is_object($response) && isset($response->id)) ? 'success' : 'error'; | ||
| $responseType = self::getResponseType(); | ||
| $typeName = !$update || (\is_object($response) && isset($response->id)) ? 'Contact-create' : 'Contact-update'; | ||
|
|
||
| $message = wp_json_encode($response); | ||
|
|
@@ -204,7 +204,7 @@ public function execute($integrationDetails, $fieldValues, $fieldMap, $actions) | |
|
|
||
| $insertLeadResponse = $this->insertLead($finalData, $update); | ||
|
|
||
| $responseType = !\is_null($insertLeadResponse) || (\is_object($insertLeadResponse) && isset($insertLeadResponse->id)) ? 'success' : 'error'; | ||
| $responseType = self::getResponseType(); | ||
| $typeName = !$update || (\is_object($insertLeadResponse) && isset($insertLeadResponse->id)) ? 'Lead-create' : 'Lead-update'; | ||
|
|
||
| $message = wp_json_encode($insertLeadResponse); | ||
|
|
@@ -502,4 +502,9 @@ private static function validateNumericDateWithLength($input, $length) | |
| { | ||
| return is_numeric($input) && \strlen($input) === $length; | ||
| } | ||
|
|
||
| private static function getResponseType() | ||
| { | ||
| return strpos(HttpHelper::$responseCode, 20) === 0 ? 'success' : 'error'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return strpos((string) HttpHelper::$responseCode, '20') === 0 ? 'success' : 'error'; |
||
| } | ||
|
Comment on lines
+506
to
+509
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$integrationDetails->actions->tagUpdateis accessed without guarding thatactionsexists, which can trigger warnings/notices (and in newer PHP versions, runtime warnings) when actions are missing. Use a safe check like!empty($integrationDetails->actions->tagUpdate)(or pass/use the$actionsargument already available inexecute()) before attempting tag removal.