Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed include handling & content parsing on PHP 8.3 #5341

Closed
ssddanbrown opened this issue Nov 27, 2024 · 2 comments
Closed

Failed include handling & content parsing on PHP 8.3 #5341

ssddanbrown opened this issue Nov 27, 2024 · 2 comments

Comments

@ssddanbrown
Copy link
Member

ssddanbrown commented Nov 27, 2024

Seems to be a recent issue, started to appear in tests.
Occurs on my dev instance using 8.3.14.
Occurs in actual use too, not just tests.

Need to understand when this started, why, and if the issue is with our code or a PHP bug.

Error detail

Details

Call to a member function importNode() on null
Stack Trace

#0 /home/dan/web/bookstack/app/Entities/Tools/PageIncludeParser.php(56): BookStack\Entities\Tools\PageIncludeParser->replaceNodeWithNodes()
#1 /home/dan/web/bookstack/app/Entities/Tools/PageContent.php(310): BookStack\Entities\Tools\PageIncludeParser->parse()
#2 /home/dan/web/bookstack/app/Entities/Controllers/PageController.php(153): BookStack\Entities\Tools\PageContent->render()
#3 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\Entities\Controllers\PageController->show()
#4 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#5 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\Routing\ControllerDispatcher->dispatch()
#6 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#7 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\Routing\Route->run()
#8 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#9 /home/dan/web/bookstack/app/Http/Middleware/Authenticate.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#10 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\Http\Middleware\Authenticate->handle()
#11 /home/dan/web/bookstack/app/Http/Middleware/Localization.php(32): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#12 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\Http\Middleware\Localization->handle()
#13 /home/dan/web/bookstack/app/Http/Middleware/RunThemeActions.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#14 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\Http\Middleware\RunThemeActions->handle()
#15 /home/dan/web/bookstack/app/Http/Middleware/CheckEmailConfirmed.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#16 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\Http\Middleware\CheckEmailConfirmed->handle()
#17 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#18 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#19 /home/dan/web/bookstack/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

Reduced Example Case

https://3v4l.org/BQFa7

@ssddanbrown
Copy link
Member Author

Only occurs on PHP 8.3.14.
Potentially a PHP bug, have raised here: php/php-src#16967
Is something we can easily work around though, so something we can add into a patch release for PHP 8.3.14 users.

@ssddanbrown
Copy link
Member Author

ssddanbrown commented Nov 27, 2024

Due to be addressed in PHP 8.3.15, reference: php/php-src#16967 (comment)

@ssddanbrown ssddanbrown added this to the v24.10.2 milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant