October 23, 20232 yr Hello everybody, I am creating a nightly export of the froxlor-settings using a cronjob: /var/www/html/froxlor/bin/froxlor-cli froxlor:api-call froxlor Froxlor.exportSettings > /var/customers/froxlor-settings.backup.json Unfortunately today I recognized the file just contains: Internal PHP error: #2 Undefined array key "groups" Any idea what could be the reason for this?
October 23, 20232 yr # bin/froxlor-cli froxlor:api-call admin Froxlor.exportSettings { "data": "{....}" } works just fine with an existing admin-user....
October 23, 20232 yr Author 5 minutes ago, d00p said: is "froxlor" an admin-user in your froxlor installation? Yes froxlor is actually the admin-user. I am pretty sure that it worked in the past.
October 23, 20232 yr Author It looks like it is working again. I suspect it works after I've created an export via the WebUI which worked immediately. I'll keep an eye on this.
October 23, 20232 yr that's unlikely to be the cause. Any custom files in froxlor/actions/admin/settings? Because they all return an array starting with index 'groups'
October 24, 20232 yr Author No I don't have any custom files in 15 hours ago, d00p said: froxlor/actions/admin/settings The issue is that it doesn't work if the command is not executed from withhin the froxlor-base directory even if the path to the froxlor-cli is absolute.
October 24, 20232 yr Solution if you want, try the following patch, it should resolve the behavior: diff --git a/lib/Froxlor/SImExporter.php b/lib/Froxlor/SImExporter.php index a40e24bb..f823f295 100644 --- a/lib/Froxlor/SImExporter.php +++ b/lib/Froxlor/SImExporter.php @@ -65,7 +65,7 @@ class SImExporter public static function export() { $settings_definitions = []; - foreach (PhpHelper::loadConfigArrayDir('./actions/admin/settings/')['groups'] as $group) { + foreach (PhpHelper::loadConfigArrayDir(Froxlor::getInstallDir() . '/actions/admin/settings/')['groups'] as $group) { foreach ($group['fields'] as $field) { $settings_definitions[$field['settinggroup']][$field['varname']] = $field; }
Create an account or sign in to comment