fix: guard instanceof ProjectPage avant getNotificationsLight
All checks were successful
Deploy Production / Build and Deploy to Production (push) Successful in 28s
All checks were successful
Deploy Production / Build and Deploy to Production (push) Successful in 28s
Les projets avec un template non-project déclenchaient le __call magique de Kirby qui retournait un Field object au lieu de lancer une exception, cassant l'affichage des notifications côté frontend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1fb4e47d8d
commit
19752f516e
1 changed files with 6 additions and 5 deletions
|
|
@ -11,11 +11,12 @@ function getProjectData($project, $user)
|
|||
{
|
||||
// Utiliser getNotificationsLight() avec cache pour optimiser les performances
|
||||
$notifications = [];
|
||||
try {
|
||||
$notifications = $project->getNotificationsLight($user);
|
||||
} catch (\Throwable $e) {
|
||||
error_log("Error getting notifications for project {$project->uri()}: " . $e->getMessage());
|
||||
$notifications = [];
|
||||
if ($project instanceof ProjectPage) {
|
||||
try {
|
||||
$notifications = $project->getNotificationsLight($user);
|
||||
} catch (\Throwable $e) {
|
||||
error_log("Error getting notifications for project {$project->uri()}: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$data = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue