Global Areas break single pages: a fix

Permalink 1 user found helpful
We found that when theming up our single pages, for example a 404 page, the global area in the footer that provides an address, some links etc was breaking:

We fixed this by copying concrete/models/global_area.php to /models/global_area.php and changing the code to:

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
class GlobalArea extends Area {
   protected $arIsGlobal = 1;
   public function display() {
      $c = Page::getCurrentPage();
        if ($c->cID === null) {
            $c = Page::getByID(1);
        }
      parent::getOrCreate($c, $this->arHandle, 1);      
      parent::display($c);
   }
}


Since the global area is a constant throughout the site, I thought the method of getting a page by ID is passable. There is probably a more elegant way though.