Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Custom pages get error after upgrade to 4.0


We added a custom project_stats page to our TestRail install to show various metrics in realtime.

Unfortunately, we get an error now:

Trying to get property of non-object
Details: <missing>
File: /var/www/testrail/app/views/layout/header.php
Line: 180
Status Code: 500
Uri: /index.php?/custom/project_stats/index/3 (GET)
at errors::show (errors.php:53)
at ErrorHandler::error (header.php:180)
at unknown (loader.php:195)
at Loader_core->view_abs (loader.php:168)
at Loader_core->view (index.php:16)
at unknown (loader.php:195)
at Loader_core->view_abs (loader.php:168)
at Loader_core->view (loader.php:216)
at Loader_core->page (project_stats.php:58)
at Project_stats_controller->index (controller.php:106)
at Controller->_invoke_web (controller.php:74)
at Controller->_invoke (gizmo.php:101)
at require_once (index.php:106)

Can you help us figure out what we are doing wrong? I can’t inspect header.php to figure it out myself.

This is what we have in our custom page that appears to trigger the issue:

$header = array(
  'page_title' => "Project statistics ($project->name)",
  'page_section' => $project->name,
  'page_backlink' => true,
  'page_menu' => 'project',
  'page_project' => $project->id,
  'page_selected_menu' => 'metrics',
  'page_flash' => true,
  'page_breadcrumb' => array(
    'dashboard' => lang('pages_dashboard'),

$GI->load->view('layout/header', $header);



Hello Logan,

Please replace:


This should do the trick.



I am currently using TestRail version Can you please point me to somewhere that explains/shows how to add a custom page?



We recommend using the reports feature that was introduced with TestRail 3.0 to add custom reports:

You can alternatively also use our API to create external integrations. If you could provide a few more details on what you are trying to accomplish, we’re happy to suggest the best way to implement this (I believe we are already on contact via email, is this correct?).