lonnieezell / Ocular-Template-Library

A template/layout library for CodeIgniter

Home Page:http://igniteyourcode.com/ocular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not reverting view loads to default theme.

kenzik opened this issue · comments

I'm working on troubleshooting this one, but wanted to log it.

Seems like if I have a theme set (this->active_theme) and it's missing a view file, it will never get to loading the missing file from the this->default_theme folder.

Upon cursory review, it seems the Template.php library is relying on $content being populated from CI->load->view to determine how to proceed. This is a catch-22 in that if CI-load->view can not find the passed view name (because say we want to revert to default), CI will throw a 404, never allowing Ocular to revert to this->default_theme's view.

I'm testing this in 2.0, FWIW.

It appears that 2.11 is either an incomplete package (missing a file) or buggy as it relates to reverting to the default template.

The solution for me was to use the previous version's MY_Loader, which will return false if Ocular is in use -- rather than performing a show_error(), allowing Ocular's logic to fall back to a default template.

Also to note, version numbers and the CHANGELOG.TXT for 2.11 reflects 2.1.0 still.

I know that was working previously. It's possible I messed it up while implementing caching. I'll look into it.

Actually, just checked Ci's Loader class, and you're right. It will not return false like I was thinking it would. So, in order to use that functionality, the old MY_Loader is required.

Sorry about that. I guess I haven't used that functionality much lately.

No worries, thanks for confirming what I found.