From 1874d82c38934c427bacecfb8581639300178672 Mon Sep 17 00:00:00 2001 From: Ian Morland Date: Sat, 21 Oct 2023 18:31:36 +0100 Subject: [PATCH] php 7.x compat --- .github/workflows/backend.yml | 2 +- src/Listener/SaveReactionsToDatabase.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index a713c22..508bfd9 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -4,7 +4,7 @@ on: [workflow_dispatch, push, pull_request] jobs: run: - uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x + uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main with: enable_backend_testing: true diff --git a/src/Listener/SaveReactionsToDatabase.php b/src/Listener/SaveReactionsToDatabase.php index 9cde916..7bf09ff 100755 --- a/src/Listener/SaveReactionsToDatabase.php +++ b/src/Listener/SaveReactionsToDatabase.php @@ -230,6 +230,7 @@ protected function isExtensionEnabled(string $extension): bool protected function getSessionId(): ?string { - return $this->request->getAttribute('session')?->getId(); + $session = $this->request->getAttribute('session'); + return $session ? $session->getId() : null; } }