@@ -83,7 +83,8 @@ |
||
83 | 83 | $productgroup = new org_openpsa_products_product_group_dba($this->_product->productGroup); |
84 | 84 | $replacements['<PRODUCTGROUP_TITLE>'] = $productgroup->title; |
85 | 85 | $replacements['<PRODUCTGROUP_CODE>'] = $productgroup->code; |
86 | - } catch (midcom_error $e) { |
|
86 | + } |
|
87 | + catch (midcom_error $e) { |
|
87 | 88 | $replacements['<PRODUCTGROUP_TITLE>'] = ''; |
88 | 89 | $replacements['<PRODUCTGROUP_CODE>'] = ''; |
89 | 90 | } |
@@ -68,7 +68,8 @@ discard block |
||
68 | 68 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
69 | 69 | |
70 | 70 | $defaults['customer'] = $customer->id; |
71 | - } catch (midcom_error $e) { |
|
71 | + } |
|
72 | + catch (midcom_error $e) { |
|
72 | 73 | $customer = new org_openpsa_contacts_person_dba($guid); |
73 | 74 | $defaults['customerContact'] = $customer->id; |
74 | 75 | $field['type_config']['options'] = $this->list_groups(new org_openpsa_sales_salesproject_dba, [$customer->id => true]); |
@@ -142,7 +143,8 @@ discard block |
||
142 | 143 | try { |
143 | 144 | $company = org_openpsa_contacts_group_dba::get_cached($company_id); |
144 | 145 | $ret[$company->id] = $company->get_label(); |
145 | - } catch (midcom_error $e) { |
|
146 | + } |
|
147 | + catch (midcom_error $e) { |
|
146 | 148 | $e->log(); |
147 | 149 | } |
148 | 150 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $password_length = mb_strlen($password); |
320 | 320 | |
321 | 321 | if ($password_length < $this->_config->get('min_password_length')) { |
322 | - if ($show_ui_message){ |
|
322 | + if ($show_ui_message) { |
|
323 | 323 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
324 | 324 | } |
325 | 325 | return false; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | if ($score < $this->_config->get('min_password_score')) { |
340 | - if ($show_ui_message){ |
|
340 | + if ($show_ui_message) { |
|
341 | 341 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
342 | 342 | } |
343 | 343 | return false; |
@@ -131,7 +131,8 @@ discard block |
||
131 | 131 | try { |
132 | 132 | $this->_backend->index($documents); |
133 | 133 | return true; |
134 | - } catch (Exception $e) { |
|
134 | + } |
|
135 | + catch (Exception $e) { |
|
135 | 136 | if ($batch) { |
136 | 137 | throw $e; |
137 | 138 | } |
@@ -160,7 +161,8 @@ discard block |
||
160 | 161 | try { |
161 | 162 | $this->_backend->delete($RIs); |
162 | 163 | return true; |
163 | - } catch (Exception $e) { |
|
164 | + } |
|
165 | + catch (Exception $e) { |
|
164 | 166 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
165 | 167 | return false; |
166 | 168 | } |
@@ -182,7 +184,8 @@ discard block |
||
182 | 184 | try { |
183 | 185 | $this->_backend->delete_all($constraint); |
184 | 186 | return true; |
185 | - } catch (Exception $e) { |
|
187 | + } |
|
188 | + catch (Exception $e) { |
|
186 | 189 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
187 | 190 | return false; |
188 | 191 | } |
@@ -216,7 +219,8 @@ discard block |
||
216 | 219 | |
217 | 220 | try { |
218 | 221 | $result_raw = $this->_backend->query($query, $filter, $options); |
219 | - } catch (Exception $e) { |
|
222 | + } |
|
223 | + catch (Exception $e) { |
|
220 | 224 | debug_add("Query error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
221 | 225 | return $result; |
222 | 226 | } |
@@ -237,7 +241,8 @@ discard block |
||
237 | 241 | if (!empty($document->topic_guid)) { |
238 | 242 | try { |
239 | 243 | midcom_db_topic::get_cached($document->topic_guid); |
240 | - } catch (midcom_error $e) { |
|
244 | + } |
|
245 | + catch (midcom_error $e) { |
|
241 | 246 | // Skip document, the object is hidden. |
242 | 247 | debug_add("Skipping the generic document {$document->title}, its topic seems to be invisible, we cannot proceed."); |
243 | 248 | continue; |
@@ -250,7 +255,8 @@ discard block |
||
250 | 255 | // Strip language code from end of RI if it looks like "<GUID>_<LANG>" |
251 | 256 | try { |
252 | 257 | midcom::get()->dbfactory->get_object_by_guid(preg_replace('/^([0-9a-f]{32,80})_[a-z]{2}$/', '\\1', $document->RI)); |
253 | - } catch (midcom_error $e) { |
|
258 | + } |
|
259 | + catch (midcom_error $e) { |
|
254 | 260 | // Skip document, the object is hidden, deleted or otherwise unavailable. |
255 | 261 | //@todo Maybe nonexistent objects should be removed from index? |
256 | 262 | continue; |
@@ -409,7 +409,8 @@ |
||
409 | 409 | //Get the parent object |
410 | 410 | try { |
411 | 411 | $parent = midcom::get()->dbfactory->get_object_by_guid($this->objectguid); |
412 | - } catch (midcom_error $e) { |
|
412 | + } |
|
413 | + catch (midcom_error $e) { |
|
413 | 414 | $e->log(); |
414 | 415 | return; |
415 | 416 | } |
@@ -95,7 +95,8 @@ |
||
95 | 95 | org_openpsa_projects_workflow::accept($task, 0, $this->comment); |
96 | 96 | return; |
97 | 97 | } |
98 | - } catch (midcom_error $e) { |
|
98 | + } |
|
99 | + catch (midcom_error $e) { |
|
99 | 100 | $e->log(); |
100 | 101 | } |
101 | 102 | } |
@@ -197,7 +197,8 @@ |
||
197 | 197 | if ($this->_response === null) { |
198 | 198 | $this->_stop('Could not handle request, unknown method', 405); |
199 | 199 | } |
200 | - } catch (midcom_error $e) { |
|
200 | + } |
|
201 | + catch (midcom_error $e) { |
|
201 | 202 | $this->_responseStatus = $e->getCode(); |
202 | 203 | return $this->_send_response($e->getMessage()); |
203 | 204 | } |
@@ -165,7 +165,8 @@ |
||
165 | 165 | try { |
166 | 166 | self::$root_topic = midcom_db_topic::get_cached($guid); |
167 | 167 | return self::$root_topic; |
168 | - } catch (midcom_error $e) { |
|
168 | + } |
|
169 | + catch (midcom_error $e) { |
|
169 | 170 | if ($e instanceof midcom_error_forbidden) { |
170 | 171 | throw $e; |
171 | 172 | } |
@@ -673,7 +673,8 @@ |
||
673 | 673 | */ |
674 | 674 | try { |
675 | 675 | return $object->get_by_id($object->id); |
676 | - } catch (Exception $e) { |
|
676 | + } |
|
677 | + catch (Exception $e) { |
|
677 | 678 | return false; |
678 | 679 | } |
679 | 680 | } |