| @@ -162,8 +162,29 @@ | ||
| 162 | 162 | ] |
| 163 | 163 | ); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | + /** | |
| 167 | + * Name-only rename of a connected account row, scoped to | |
| 168 | + * category=connected_integration_apps and this handler's form id (0). | |
| 169 | + * updateIntegration() is unusable here: it overwrites details/type/category/status. | |
| 170 | + */ | |
| 171 | + public function renameConnectedApp($integrationID, $integrationName) | |
| 172 | + { | |
| 173 | + $data = ['integration_name' => $integrationName]; | |
| 174 | + if (!empty($this->_user_details['time'])) { | |
| 175 | + $data['updated_at'] = $this->_user_details['time']; | |
| 176 | + } | |
| 177 | + return static::$_integrationModel->update( | |
| 178 | + $data, | |
| 179 | + [ | |
| 180 | + 'id' => $integrationID, | |
| 181 | + 'form_id' => $this->_formID, | |
| 182 | + 'category' => 'connected_integration_apps', | |
| 183 | + ] | |
| 184 | + ); | |
| 185 | + } | |
| 186 | + | |
| 166 | 187 | public function updateIntegrationStatus($integrationID, $status) |
| 167 | 188 | { |
| 168 | 189 | $data = ['status' => (int) $status]; |
| 169 | 190 | if (!empty($this->_user_details['time'])) { |
| @@ -317,14 +338,19 @@ | ||
| 317 | 338 | } |
| 318 | 339 | |
| 319 | 340 | $triggerData = $workFlowReturnedData['triggerData']; |
| 320 | 341 | |
| 342 | + if (!isset($workFlowReturnedData['fields'])) { | |
| 343 | + $workFlowReturnedData['fields'] = isset($workFlowReturnedData['updatedData']) | |
| 344 | + ? $workFlowReturnedData['updatedData'] | |
| 345 | + : []; | |
| 346 | + } | |
| 347 | + | |
| 321 | 348 | $trnasientData = get_transient("bitform_trigger_transient_{$entryId}"); |
| 322 | 349 | $trnasientData = is_string($trnasientData) ? json_decode($trnasientData) : $trnasientData; |
| 323 | 350 | |
| 324 | 351 | if (!empty($trnasientData['fields'])) { |
| 325 | - $fieldData = isset($workFlowReturnedData['fields']) ? $workFlowReturnedData['fields'] : $workFlowReturnedData['updatedData']; | |
| 326 | - $workFlowReturnedData['fields'] = array_merge($fieldData, $trnasientData['fields']); | |
| 352 | + $workFlowReturnedData['fields'] = array_merge($workFlowReturnedData['fields'], $trnasientData['fields']); | |
| 327 | 353 | } |
| 328 | 354 | |
| 329 | 355 | if (function_exists('fastcgi_finish_request') || !wp_doing_ajax()) { |
| 330 | 356 | if (!headers_sent()) { |