Skip to content

Commit 75e1a16

Browse files
committed
Merge branch '3.x'
2 parents 30a7b68 + 638836e commit 75e1a16

5 files changed

Lines changed: 26 additions & 14 deletions

File tree

app/admin/formwidgets/StatusEditor.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Admin\Classes\BaseFormWidget;
88
use Admin\Classes\FormField;
99
use Admin\Facades\AdminAuth;
10+
use Admin\Facades\AdminLocation;
1011
use Admin\Models\Orders_model;
1112
use Admin\Models\Staff_groups_model;
1213
use Admin\Models\Staffs_model;
@@ -162,15 +163,13 @@ public function onSaveRecord()
162163
throw new ApplicationException(sprintf(lang('admin::lang.statuses.alert_already_added'), $context, $context));
163164

164165
$this->validateFormWidget($form, $saveData);
165-
}
166-
catch (ValidationException $ex) {
166+
} catch (ValidationException $ex) {
167167
throw new ApplicationException($ex->getMessage());
168168
}
169169

170170
if ($this->saveRecord($saveData, $keyFrom)) {
171171
flash()->success(sprintf(lang('admin::lang.alert_success'), lang($this->getModeConfig('formName')).' '.'updated'))->now();
172-
}
173-
else {
172+
} else {
174173
flash()->error(lang('admin::lang.alert_error_try_again'))->now();
175174
}
176175

@@ -207,7 +206,7 @@ public function onLoadAssigneeList()
207206
$formField = $form->getField($this->assigneeKeyFrom);
208207

209208
return [
210-
'#'.$formField->getId() => $form->renderField($formField, [
209+
'#'.$formField->getId('group') => $form->renderField($formField, [
211210
'useContainer' => false,
212211
]),
213212
];
@@ -236,9 +235,15 @@ public static function getAssigneeOptions($form, $field)
236235
if (!strlen($groupId = post('groupId', $form->getField('assignee_group_id')->value)))
237236
return [];
238237

239-
return Staffs_model::whereHas('groups', function ($query) use ($groupId) {
238+
$query = Staffs_model::whereHas('groups', function ($query) use ($groupId) {
240239
$query->where('staff_groups.staff_group_id', $groupId);
241-
})->isEnabled()->dropdown('staff_name');
240+
});
241+
242+
if ($locationId = AdminLocation::getId()) {
243+
$query->whereHasLocation($locationId);
244+
}
245+
246+
return $query->isEnabled()->dropdown('staff_name');
242247
}
243248

244249
public static function getAssigneeGroupOptions()
@@ -335,8 +340,7 @@ protected function saveRecord(array $saveData, string $keyFrom)
335340
$staff = Staffs_model::find(array_get($saveData, $keyFrom));
336341
if ($record = $this->model->updateAssignTo($group, $staff))
337342
AssigneeUpdated::log($record, $this->getController()->getUser());
338-
}
339-
else {
343+
} else {
340344
$status = Statuses_model::find(array_get($saveData, $keyFrom));
341345
if ($record = $this->model->addStatusHistory($status, $saveData))
342346
StatusUpdated::log($record, $this->getController()->getUser());

app/admin/widgets/DashboardContainer.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,13 @@ protected function makeDashboardWidget($alias, $widgetConfig)
372372
$widgetConfig['widget'] = $widgetCode = $widgetConfig['widget'] ?? $widgetConfig['class'] ?? $alias;
373373
$widgetClass = Widgets::instance()->resolveDashboardWidget($widgetCode);
374374

375-
$widget = $this->makeWidget($widgetClass, $widgetConfig);
376-
$widget->bindToController();
377375

378-
return $widget;
376+
return rescue(function () use ($widgetClass, $widgetConfig) {
377+
$widget = $this->makeWidget($widgetClass, $widgetConfig);
378+
$widget->bindToController();
379+
380+
return $widget;
381+
});
379382
}
380383

381384
protected function resetWidgets()

app/system/libraries/Assets.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ protected function getAssetPath($name)
249249
if (File::isPathSymbol($name))
250250
return File::symbolizePath($name);
251251

252+
// Resolve temporarily open_basedir issue https://github.com/tastyigniter/TastyIgniter/pull/1061
253+
if (File::isFile('.'.$name))
254+
return '.'.$name;
255+
252256
if (File::isFile($name))
253257
return $name;
254258

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
},
6161
"config": {
6262
"allow-plugins": {
63-
"composer/installers": true
63+
"composer/installers": true,
64+
"wikimedia/composer-merge-plugin": true
6465
}
6566
}
6667
}

config/system.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
|
194194
*/
195195

196-
'urlPolicy' => 'force',
196+
'urlPolicy' => env('IGNITER_URL_POLICY', 'detect'),
197197

198198
/*
199199
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)