Undefined property: stdClass::$type (on PHP 8.1.18) #3770

Closed
opened 2026-02-05 07:23:14 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @ghormoon on GitHub (Apr 27, 2023).

Describe the Bug

on php 8.1.18 (centos stream 8) we're getting Undefined property: stdClass::$type

i had to change this line 647ce6c237/app/Settings/SettingService.php (L126)

to

if (gettype($setting) === 'array') {

Steps to Reproduce

Install bookstack 23.02.3 on almalinux 9

Expected Behaviour

app running

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v23.0.2

PHP Version

8.1.18

Hosting Environment

CentosStream 8 - edit: sorry, i mixed up servers, we have most on alma, not this one yet

Originally created by @ghormoon on GitHub (Apr 27, 2023). ### Describe the Bug on php 8.1.18 (centos stream 8) we're getting Undefined property: stdClass::$type i had to change this line https://github.com/BookStackApp/BookStack/blob/647ce6c237457aa69135ca80849b8ef0fdfc5b7a/app/Settings/SettingService.php#L126 to ``` if (gettype($setting) === 'array') { ``` ### Steps to Reproduce Install bookstack 23.02.3 on almalinux 9 ### Expected Behaviour app running ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version v23.0.2 ### PHP Version 8.1.18 ### Hosting Environment CentosStream 8 - edit: sorry, i mixed up servers, we have most on alma, not this one yet
OVERLORD added the 🐛 Bug label 2026-02-05 07:23:14 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 27, 2023):

Hi @ghormoon,
This indicate that something else is wrong on your instance.

  • Have you made modifications to BookStack in any way?
  • What is the current output of running git status from your BookStack install directory?
  • What is the current output of running php artisan migrate from your BookStack install directory?
@ssddanbrown commented on GitHub (Apr 27, 2023): Hi @ghormoon, This indicate that something else is wrong on your instance. - Have you made modifications to BookStack in any way? - What is the current output of running `git status` from your BookStack install directory? - What is the current output of running `php artisan migrate` from your BookStack install directory?
Author
Owner

@ghormoon commented on GitHub (Apr 27, 2023):

ok, i tested again, and roll-backing the change doesn't break it anymore, so it's needed only when the db is not migrated

what i did previously was to try to upgrade to v23.02.3 because someone upgraded php to 8.1 which broke it

then i found out this error, did the hotfix
next i got error about a missing table, so i run php artisan migrate
and the app run. i didn't think of roll-backing the change in php code until now

is it supposed to show some readable error saying that i need to migrate database? maybe only that codepath has this issue

@ghormoon commented on GitHub (Apr 27, 2023): ok, i tested again, and roll-backing the change doesn't break it anymore, so it's needed only when the db is not migrated what i did previously was to try to upgrade to v23.02.3 because someone upgraded php to 8.1 which broke it then i found out this error, did the hotfix next i got error about a missing table, so i run php artisan migrate and the app run. i didn't think of roll-backing the change in php code until now is it supposed to show some readable error saying that i need to migrate database? maybe only that codepath has this issue
Author
Owner

@ssddanbrown commented on GitHub (Apr 27, 2023):

is it supposed to show some readable error saying that i need to migrate database?

No, because migrating the database is a mandatory and expected step in the install and update process of the system, so you should never be using the system in an non-migrated state.

@ssddanbrown commented on GitHub (Apr 27, 2023): > is it supposed to show some readable error saying that i need to migrate database? No, because migrating the database is a mandatory and expected step in the install and update process of the system, so you should never be using the system in an non-migrated state.
Author
Owner

@ghormoon commented on GitHub (Apr 27, 2023):

i guess we can close it then. either the code has the property at that point with the right db, or it doesn't reach it at all

it would be nice to show some nice message that you need to migrate the db, but that's a thing for nice-to-have feature request, not a bug

@ghormoon commented on GitHub (Apr 27, 2023): i guess we can close it then. either the code has the property at that point with the right db, or it doesn't reach it at all it would be nice to show some nice message that you need to migrate the db, but that's a thing for nice-to-have feature request, not a bug
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3770