forked from Public/pics
EditAlbum: choose the first non-root album as the default parent
This commit is contained in:
parent
45b59636f6
commit
89cc00ffd9
@ -139,6 +139,13 @@ class EditAlbum extends HTMLController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif (empty($_POST) && count($parentChoices) > 1)
|
||||||
|
{
|
||||||
|
// Choose the first non-root album as the default parent
|
||||||
|
reset($parentChoices);
|
||||||
|
next($parentChoices);
|
||||||
|
$formDefaults = ['id_parent' => key($parentChoices)];
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($formDefaults))
|
if (!isset($formDefaults))
|
||||||
$formDefaults = isset($album) ? get_object_vars($album) : $_POST;
|
$formDefaults = isset($album) ? get_object_vars($album) : $_POST;
|
||||||
|
Loading…
Reference in New Issue
Block a user