Skip to content

Volumes can have no lastwritten (HTTP 500) #175

@BoresXP

Description

@BoresXP

Describe the bug
Navigating to volumes page shows 500 error. That happens when you have volumes (media entities in DB) with lastwritten set no NULL. Such entities are shown correctly in bconsole but breaks bacula-web.
In PHP log such error is shown:

PHP Fatal error:  Uncaught TypeError: strtotime(): Argument #1 ($datetime) must be of type string, null given in /srv/bacula-web/application/Con
Stack trace:
#0 /srv/bacula-web/application/Controller/VolumesController.php(162): strtotime()
#1 [internal function]: App\Controller\VolumesController->prepare()
#2 /srv/bacula-web/application/Middleware/RouterMiddleware.php(69): call_user_func()
#3 /srv/bacula-web/core/App/WebApplication.php(266): App\Middleware\RouterMiddleware->process()
#4 /srv/bacula-web/core/App/WebApplication.php(208): Core\App\WebApplication->pipeMiddleware()
#5 /srv/bacula-web/public/index.php(34): Core\App\WebApplication->handle()
#6 {main}
  thrown in /srv/bacula-web/application/Controller/VolumesController.php on line 162
``

`**To Reproduce**
Steps to reproduce the behavior:
1. Go to 'volumes' report
2. See error 500

**Expected behavior**
Report should be shown

**Screenshots**
n/a

**Desktop (please complete the following information):**
 - OS: Windows 10
 - Browser: Chrome 113
 - Version: 8.9.0
 - PHP version: 8.1

**Additional context**

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions