feat: Inject password from db during testing when editing enhanced apps

This commit is contained in:
Attila Kerekes
2022-11-19 20:21:10 +01:00
committed by Attila Jozsef Kerekes
parent 9a80064a50
commit 8bad474808
6 changed files with 33 additions and 2824 deletions

View File

@@ -407,6 +407,15 @@ class ItemController extends Controller
$single = Application::single($data['type']);
$app = $single->class;
// If password is not resubmitted fill it from the database when in edit mode
if ($data['password'] === null && array_key_exists('id', $data)) {
$item = Item::find($data['id']);
if ($item) {
$itemConfig = $item->getConfig();
$data['password'] = $itemConfig->password;
}
}
$app_details = new $app();
$app_details->config = (object) $data;
$app_details->test();