fix: creates form for user media preferences

This commit is contained in:
2025-07-23 21:17:18 -05:00
parent 8ff9cddbb0
commit 93f5b716b2
10 changed files with 150 additions and 94 deletions

View File

@@ -34,14 +34,14 @@ class UserPreferencesFactory
private static function getNestedValue(UserInterface $user, string $preferenceId): ?string
{
$preference = $user->getUserPreference($preferenceId);
if (null === $preference) {
if (null === $preference || "" === $preference || null === $preference->getPreferenceValue() || "" === $preference->getPreferenceValue()) {
return null;
}
return $preference->getPreference()
->getPreferenceOptions()
->filter(fn (PreferenceOption $option) => (string) $option->getId() === $preference->getPreferenceValue())
->first()
->getValue()
->getId()
;
}
}