PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.0
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.0
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
← All changes | app/Models/Person.php +7 -8 1.10.52.4.0 View file →
@@ -64,9 +64,9 @@
64 64 $fields = $this->searchable;
65 65 $query->where(function ($query) use ($fields, $search) {
66 66 $query->where(array_shift($fields), 'LIKE', "%$search%");
67 67
68 - $nameArray = explode(' ', $search);
68 + $nameArray = explode(' ', (string) $search);
69 69 if (count($nameArray) >= 2) {
70 70 $query->orWhere(function ($q) use ($nameArray) {
71 71 $fname = array_shift($nameArray);
72 72 $lastName = implode(' ', $nameArray);
@@ -121,9 +121,9 @@
121 121 if (isset($this->attributes['last_name'])) {
122 122 $fallBackName .= '+' . $this->attributes['last_name'];
123 123 }
124 124
125 - $hash = md5(strtolower(trim($this->attributes['email'])));
125 + $hash = md5(strtolower(trim($this->attributes['email'] ?? '')));
126 126
127 127 $fallback = '';
128 128 if ($fallBackName) {
129 129 $fallback = '&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F' . urlencode($fallBackName) . '/128';
@@ -208,9 +208,9 @@
208 208 ->where('key', $metaKey)
209 209 ->first();
210 210 if ($meta) {
211 211 $meta->value = maybe_serialize($metaValue);
212 - $meta->update();
212 + $meta->save();
213 213 }
214 214
215 215 if (!$meta) {
216 216 Meta::create([
@@ -230,13 +230,12 @@
230 230 ->where('object_type', 'person_meta')
231 231 ->delete();
232 232 }
233 233
234 - public function restoreAvatar($person, $id)
234 + public function restoreAvatar()
235 235 {
236 - $person->where('id', $id)->update([
237 - 'avatar' => null
238 - ]);
236 + $this->avatar = null;
237 + $this->save();
239 238
240 - return $person;
239 + return $this;
241 240 }
242 241 }