@@ -63,7 +63,8 @@ |
||
| 63 | 63 | |
| 64 | 64 | try { |
| 65 | 65 | $attachment = new midcom_db_attachment($guid); |
| 66 | - } catch (midcom_error $e) { |
|
| 66 | + } |
|
| 67 | + catch (midcom_error $e) { |
|
| 67 | 68 | $e->log(); |
| 68 | 69 | return "<span class=\"missing_photo\" title=\"{$guid}\">{$fulltag}</span>{$after}"; |
| 69 | 70 | } |
@@ -147,7 +147,8 @@ discard block |
||
| 147 | 147 | foreach ($activities as $activity) { |
| 148 | 148 | try { |
| 149 | 149 | $object = midcom::get()->dbfactory->get_object_by_guid($activity->target); |
| 150 | - } catch (midcom_error $e) { |
|
| 150 | + } |
|
| 151 | + catch (midcom_error $e) { |
|
| 151 | 152 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
| 152 | 153 | // TODO: Visualize deleted objects somehow |
| 153 | 154 | } |
@@ -155,7 +156,8 @@ discard block |
||
| 155 | 156 | } |
| 156 | 157 | try { |
| 157 | 158 | $actor = midcom_db_person::get_cached($activity->actor); |
| 158 | - } catch (midcom_error $e) { |
|
| 159 | + } |
|
| 160 | + catch (midcom_error $e) { |
|
| 159 | 161 | $actor = null; |
| 160 | 162 | } |
| 161 | 163 | |
@@ -253,7 +255,8 @@ discard block |
||
| 253 | 255 | foreach ($guids as $guid) { |
| 254 | 256 | try { |
| 255 | 257 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 256 | - } catch (midcom_error $e) { |
|
| 258 | + } |
|
| 259 | + catch (midcom_error $e) { |
|
| 257 | 260 | continue; |
| 258 | 261 | } |
| 259 | 262 | |
@@ -270,7 +273,8 @@ discard block |
||
| 270 | 273 | foreach ($guids as $guid) { |
| 271 | 274 | try { |
| 272 | 275 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 273 | - } catch (midcom_error $e) { |
|
| 276 | + } |
|
| 277 | + catch (midcom_error $e) { |
|
| 274 | 278 | continue; |
| 275 | 279 | } |
| 276 | 280 | |
@@ -34,7 +34,8 @@ discard block |
||
| 34 | 34 | // Add person to campaign |
| 35 | 35 | try { |
| 36 | 36 | $campaign = new org_openpsa_directmarketing_campaign_dba($_POST['add_to_campaign']); |
| 37 | - } catch (midcom_error $e) { |
|
| 37 | + } |
|
| 38 | + catch (midcom_error $e) { |
|
| 38 | 39 | // FIXME: More informative error message |
| 39 | 40 | $this->notify('Failed adding person %s to campaign %s', $_POST['add_to_campaign'], 'error'); |
| 40 | 41 | return; |
@@ -87,7 +88,8 @@ discard block |
||
| 87 | 88 | try { |
| 88 | 89 | $campaigns[$membership->campaign] = new org_openpsa_directmarketing_campaign_dba($membership->campaign); |
| 89 | 90 | $campaign_membership_map[$membership->campaign] = $membership; |
| 90 | - } catch (midcom_error $e) { |
|
| 91 | + } |
|
| 92 | + catch (midcom_error $e) { |
|
| 91 | 93 | debug_add('Failed to load campaign ' . $membership->campaign . ', reason: ' . $e->getMessage()); |
| 92 | 94 | } |
| 93 | 95 | } |
@@ -120,14 +120,16 @@ |
||
| 120 | 120 | if (!empty($this->customer)) { |
| 121 | 121 | try { |
| 122 | 122 | return org_openpsa_contacts_group_dba::get_cached($this->customer); |
| 123 | - } catch (midcom_error $e) { |
|
| 123 | + } |
|
| 124 | + catch (midcom_error $e) { |
|
| 124 | 125 | $e->log(); |
| 125 | 126 | } |
| 126 | 127 | } |
| 127 | 128 | if (!empty($this->customerContact)) { |
| 128 | 129 | try { |
| 129 | 130 | return org_openpsa_contacts_person_dba::get_cached($this->customerContact); |
| 130 | - } catch (midcom_error $e) { |
|
| 131 | + } |
|
| 132 | + catch (midcom_error $e) { |
|
| 131 | 133 | $e->log(); |
| 132 | 134 | } |
| 133 | 135 | } |
@@ -104,7 +104,8 @@ discard block |
||
| 104 | 104 | $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer); |
| 105 | 105 | $entry['customer'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$customer->guid}/\">" . $customer->get_label() . "</a>"; |
| 106 | 106 | $entry['index_customer'] = $customer->get_label(); |
| 107 | - } catch (midcom_error $e) { |
|
| 107 | + } |
|
| 108 | + catch (midcom_error $e) { |
|
| 108 | 109 | $entry['customer'] = ''; |
| 109 | 110 | $entry['index_customer'] = ''; |
| 110 | 111 | } |
@@ -115,7 +116,8 @@ discard block |
||
| 115 | 116 | $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact); |
| 116 | 117 | $entry['contact'] = "<a href=\"{$this->_request_data['invoices_url']}list/customer/all/{$contact->guid}/\">" . $contact->get_label() . "</a>"; |
| 117 | 118 | $entry['index_contact'] = $contact->get_label(); |
| 118 | - } catch (midcom_error $e) { |
|
| 119 | + } |
|
| 120 | + catch (midcom_error $e) { |
|
| 119 | 121 | $entry['contact'] = ''; |
| 120 | 122 | $entry['index_contact'] = ''; |
| 121 | 123 | } |
@@ -290,7 +292,8 @@ discard block |
||
| 290 | 292 | { |
| 291 | 293 | try { |
| 292 | 294 | $this->_customer = new org_openpsa_contacts_group_dba($args[0]); |
| 293 | - } catch (midcom_error $e) { |
|
| 295 | + } |
|
| 296 | + catch (midcom_error $e) { |
|
| 294 | 297 | $this->_customer = new org_openpsa_contacts_person_dba($args[0]); |
| 295 | 298 | } |
| 296 | 299 | $data['customer'] = $this->_customer; |
@@ -38,13 +38,15 @@ |
||
| 38 | 38 | try { |
| 39 | 39 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($item->deliverable); |
| 40 | 40 | $entry['deliverable'] = $deliverable->title; |
| 41 | - } catch (midcom_error $e) { |
|
| 41 | + } |
|
| 42 | + catch (midcom_error $e) { |
|
| 42 | 43 | $entry['deliverable'] = ''; |
| 43 | 44 | } |
| 44 | 45 | try { |
| 45 | 46 | $task = org_openpsa_projects_task_dba::get_cached($item->task); |
| 46 | 47 | $entry['task'] = $task->title; |
| 47 | - } catch (midcom_error $e) { |
|
| 48 | + } |
|
| 49 | + catch (midcom_error $e) { |
|
| 48 | 50 | $entry['task'] = ''; |
| 49 | 51 | } |
| 50 | 52 | |
@@ -66,7 +66,8 @@ discard block |
||
| 66 | 66 | try { |
| 67 | 67 | $person1 = new org_openpsa_contacts_person_dba($param->parentguid); |
| 68 | 68 | $person2 = new org_openpsa_contacts_person_dba($param->name); |
| 69 | - } catch (midcom_error $e) { |
|
| 69 | + } |
|
| 70 | + catch (midcom_error $e) { |
|
| 70 | 71 | $i++; |
| 71 | 72 | continue; |
| 72 | 73 | } |
@@ -137,7 +138,8 @@ discard block |
||
| 137 | 138 | try { |
| 138 | 139 | $merger = new org_openpsa_contacts_duplicates_merge('person', $this->_config); |
| 139 | 140 | $merger->merge_delete($person1, $person2); |
| 140 | - } catch (midcom_error $e) { |
|
| 141 | + } |
|
| 142 | + catch (midcom_error $e) { |
|
| 141 | 143 | // TODO: Localize |
| 142 | 144 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), 'Merge failed, errstr: ' . $e->getMessage(), 'error'); |
| 143 | 145 | } |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | $file = $this->stat($test); |
| 83 | 83 | $this->clearcache(); |
| 84 | 84 | |
| 85 | - if ($file && $file['name'] === $name) { // file exists and check filename for item ID based filesystem |
|
| 85 | + if ($file && $file['name'] === $name) { |
|
| 86 | +// file exists and check filename for item ID based filesystem |
|
| 86 | 87 | // check POST data `overwrite` for 3rd party uploader |
| 87 | 88 | $overwrite = isset($_POST['overwrite'])? (bool)$_POST['overwrite'] : $this->options['uploadOverwrite']; |
| 88 | 89 | if ($overwrite) { |
@@ -135,11 +136,13 @@ discard block |
||
| 135 | 136 | { |
| 136 | 137 | try { |
| 137 | 138 | return org_openpsa_documents_document_dba::get_cached($path); |
| 138 | - } catch (midcom_error $e) { |
|
| 139 | + } |
|
| 140 | + catch (midcom_error $e) { |
|
| 139 | 141 | $e->log(); |
| 140 | 142 | try { |
| 141 | 143 | return org_openpsa_documents_directory::get_cached($path); |
| 142 | - } catch (midcom_error $e) { |
|
| 144 | + } |
|
| 145 | + catch (midcom_error $e) { |
|
| 143 | 146 | $e->log(); |
| 144 | 147 | } |
| 145 | 148 | } |
@@ -275,7 +278,8 @@ discard block |
||
| 275 | 278 | $object = midcom::get()->dbfactory->get_object_by_guid($path); |
| 276 | 279 | try { |
| 277 | 280 | $parentdir = org_openpsa_documents_directory::get_cached($parent); |
| 278 | - } catch (midcom_error $e) { |
|
| 281 | + } |
|
| 282 | + catch (midcom_error $e) { |
|
| 279 | 283 | $e->log(); |
| 280 | 284 | return false; |
| 281 | 285 | } |
@@ -571,7 +575,8 @@ discard block |
||
| 571 | 575 | try { |
| 572 | 576 | $doc = new org_openpsa_documents_document_dba($path); |
| 573 | 577 | return $doc->delete(); |
| 574 | - } catch (midcom_error $e) { |
|
| 578 | + } |
|
| 579 | + catch (midcom_error $e) { |
|
| 575 | 580 | return false; |
| 576 | 581 | } |
| 577 | 582 | } |
@@ -32,7 +32,8 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | try { |
| 34 | 34 | $date = new DateTime($requested_time); |
| 35 | - } catch (Exception $e) { |
|
| 35 | + } |
|
| 36 | + catch (Exception $e) { |
|
| 36 | 37 | return false; |
| 37 | 38 | } |
| 38 | 39 | $offset = $date->format('N') - 1; |
@@ -119,7 +120,8 @@ discard block |
||
| 119 | 120 | foreach ($hours as $guid => $row) { |
| 120 | 121 | try { |
| 121 | 122 | $task = org_openpsa_projects_task_dba::get_cached($row['task']); |
| 122 | - } catch (midcom_error $e) { |
|
| 123 | + } |
|
| 124 | + catch (midcom_error $e) { |
|
| 123 | 125 | // Task couldn't be loaded, probably because of ACL |
| 124 | 126 | continue; |
| 125 | 127 | } |
@@ -132,7 +134,8 @@ discard block |
||
| 132 | 134 | $person_object = org_openpsa_contacts_person_dba::get_cached($row['person']); |
| 133 | 135 | $person_label = $this->_get_list_link($person_object->name, null, null, $row['person']); |
| 134 | 136 | $person_name = $person_object->name; |
| 135 | - } catch (midcom_error $e) { |
|
| 137 | + } |
|
| 138 | + catch (midcom_error $e) { |
|
| 136 | 139 | $person_label = $this->_l10n->get('no person'); |
| 137 | 140 | $person_name = ''; |
| 138 | 141 | } |