mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
remove db cleaner for encrypted selections
This commit is contained in:
parent
aa8af2220c
commit
4327653d70
|
@ -28,7 +28,6 @@ class LabelsController extends Controller
|
|||
*/
|
||||
public function show(string $labelName)
|
||||
{
|
||||
$this->clearEncryptedLabelOptions();
|
||||
$labelName = str_replace('/', '\\', $labelName);
|
||||
$template = Label::find($labelName);
|
||||
|
||||
|
@ -97,23 +96,4 @@ class LabelsController extends Controller
|
|||
|
||||
return redirect()->route('home')->with('error', trans('admin/labels/message.does_not_exist'));
|
||||
}
|
||||
|
||||
private function clearEncryptedLabelOptions()
|
||||
{
|
||||
|
||||
$customfields = CustomField::where('field_encrypted', 1)->get();
|
||||
$selected_label_options = Setting::getSettings()->label2_fields;
|
||||
if($selected_label_options != '') {
|
||||
}
|
||||
collect(explode(';', Setting::getSettings()->label2_fields))
|
||||
->filter()
|
||||
->each(function ($item) use ($customfields, $selected_label_options) {
|
||||
if (!str_contains($item, $customfields->db_column)) {
|
||||
$selected_label_options .= $item;
|
||||
}
|
||||
DB::table('Settings')->update(['label2_fields' => $selected_label_options]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue