Call to a member function hasPageThemeGridFrameworkOffsetClasses() on null

Permalink
I am creating a custom theme by following the Theme Development Training youtube series. I was moving the header contents from default.php to header.php. That failed on getthemepath not found so I moved the code back into default.php and received this error. Code worked previously. I tried deactivating and re-installing my theme to no avail. I have no idea where to go from here. I am using version 5.7.5.9. Thanks in advance.

 
ekempter replied on at Permalink Reply
Bump
ob7dev replied on at Permalink Reply
ob7dev
Take a look out how to the elemental theme includes the header.php file into default:
$this->inc('elements/header.php');


You shouldn't need to use getThemePath for including a php file, as that's what the built in $this->inc method is for.

Also check out the cloneamental theme (https://www.concrete5.org/marketplace/themes/cloneamental/... )

Its a great starting point for building a custom theme.
ekempter replied on at Permalink Reply 1 Attachment
Thank you for responding. At this point I am just trying to get to working the way it was before. I have attached my source if anyone would be kind enough to take a look.
Gondwana replied on at Permalink Reply
Gondwana
hasPageThemeGridFrameworkOffsetClasses() doesn't seem to be mentioned in that file. Perhaps you've still got it in an included file. Find it, see what object it's being applied to, and ensure that that object is being initialised or passed.
ob7dev replied on at Permalink Reply
ob7dev
Whats the link to the video your watching?

I suggest you use some kind of code editor, if your on windows try Sublime Text. Currently your file has DOS line breaks at the end of every line (could be because it was saved as a .txt though).
ekempter replied on at Permalink Reply
This is part one: https://www.youtube.com/watch?v=a9iTASByiQM...

I may have found the problem. If I call localhost/index.php/ I get the error. If I call localhost/index.php/home, the page resolves correctly. Is this a configuration issue or an id10t issue?

Thanks for the multiple tips. I will be checking the all out.
Gondwana replied on at Permalink Reply
Gondwana
Another possible factor is .htaccess. You could have a very careful look in there to see if it's doing any URL rewriting.
ekempter replied on at Permalink Reply
Not unless concrete5 added it. This software seems to be anything but easy to use.
Gondwana replied on at Permalink Reply
Gondwana
I think some of the settings in concrete5's SEO area in dashboard can change .htaccess. CPanel (if relevant) can also be used to change it.
katz515 replied on at Permalink Reply
katz515
We had a Japanese user who had exact same problem after upgrading from 5.7.4.x. to 5.7.5.8.

I fixed her problem by adding

protected $pThemeGridFrameworkHandle = 'bootstrap3';


to the page_theme.php even though your theme doesn't use grid system.

Those tutorial video was probably made pre 5.7.5.x, which did't have this problem,
ekempter replied on at Permalink Reply
This one?:
<?php
namespace Concrete\Theme\Concrete;
class PageTheme extends \Concrete\Core\Page\Theme\Theme {

public function registerAssets() {
$this->providesAsset('css', 'core/frontend/*');
$this->requireAsset('javascript-conditional', 'html5-shiv');
$this->requireAsset('javascript-conditional', 'respond');
}

}

Where should the line be added? Thanks.
ob7dev replied on at Permalink Reply
ob7dev
put it after the registerAssets function:
<?php
namespace Concrete\Theme\Concrete;
class PageTheme extends \Concrete\Core\Page\Theme\Theme {
     public function registerAssets() {
          $this->providesAsset('css', 'core/frontend/*');
          $this->requireAsset('javascript-conditional', 'html5-shiv');
          $this->requireAsset('javascript-conditional', 'respond');
     }
     protected $pThemeGridFrameworkHandle = 'bootstrap3';
}

And if this solves your problems I'd mark katz515 as the best answer.
ekempter replied on at Permalink Reply
Thanks but I am getting the same error after adding the above...
ob7dev replied on at Permalink Reply
ob7dev
Did you clear the site cache? It may be loading the cached file.
ekempter replied on at Permalink Reply
Regrettably that did not help...
ob7dev replied on at Permalink Reply
ob7dev
Can you zip your files up for us to look at?