Jump to content
Froxlor Forum
  • 0

Internal PHP error: #2 Undefined array key "groups"


Question

Posted

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?

8 answers to this question

Recommended Posts

  • 0
Posted

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;
                        }

 

  • 0
Posted
# bin/froxlor-cli froxlor:api-call admin Froxlor.exportSettings
{
    "data": "{....}"
}

works just fine with an existing admin-user....

  • 0
Posted
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. 

  • 0
Posted

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.

  • 0
Posted

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'

  • 0
Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...