Fix: Use addInlineStyle with proper args

This commit is contained in:
2026-04-16 14:45:34 +02:00
parent af59c0c002
commit 81b26d58a3

View File

@@ -29,28 +29,24 @@ class Application extends App implements IBootstrap {
$value = $config->getAppValue('minimalprofile', 'hidden_fields', ''); $value = $config->getAppValue('minimalprofile', 'hidden_fields', '');
$hidden = ($value !== '') ? json_decode($value, true) ?? [] : []; $hidden = ($value !== '') ? json_decode($value, true) ?? [] : [];
$css = '';
if (!empty($hidden)) { if (!empty($hidden)) {
$selectors = [ $selectors = [
'pronouns' => '#account-property-pronouns', 'pronouns' => '#account-property-pronouns',
'role' => '#account-property-role', 'role' => '#account-property-role',
'headline' => '#account-property-headline', 'headline' => '#account-property-headline',
]; ];
$css = '';
foreach ($hidden as $field) { foreach ($hidden as $field) {
if (isset($selectors[$field])) { if (isset($selectors[$field])) {
$css .= $selectors[$field] . ' { display: none !important; }' . "\n"; $css .= $selectors[$field] . ' { display: none !important; }' . "\n";
} }
} }
} else {
// Debug if ($css) {
$css = 'body { border: 40px solid orange !important; }'; Util::addInlineStyle('minimalprofile', $css);
}
} }
if ($css) { file_put_contents('/tmp/minimalprofile_debug.log', date('Y-m-d H:i:s') . ' boot done, hidden: ' . print_r($hidden, true) . "\n", FILE_APPEND);
Util::addStyle('minimalprofile', $css);
}
// Also log to file as backup
file_put_contents('/tmp/minimalprofile_debug.log', date('Y-m-d H:i:s') . ' boot called, hidden: ' . print_r($hidden, true) . "\n", FILE_APPEND);
} }
} }