Overloading views/kohana/error.php

tkott

Joined: 2010-06-07
Posts: 225
Posted: Wed, 2012-11-28 04:03

While writing my OpenID module (big update to come, btw), I wanted to make sure that the 404 errors that ask for a login do so using my rebuilt login page (openid/views/openid_login.html.php). I found that https://github.com/gallery/gallery3/blob/master/system/core/Kohana_Exception.php defines the template to use as "kohana/error.php", which I found in both /system/views/kohana/error.php AND /modules/gallery/views/kohana/error.php.

So I figured that I could simply add the same file to my module: modules/openid/views/kohana/error.php. I did that, but the old error page is still loading up. Is this type of overloading possible? If yes, what am I doing wrong? If not, what is the right way around it?

For example, I could also overload the Kohana_Exception class to redefine $template using MY_Kohana_Exception, but then I would be overwriting the modules/gallery implementation of MY_Kohana_Exception, right? Or would openid/MY_Kohana_Exception extend gallery/MY_Kohana_Exception which extends system/Kohana_Exception?

Thanks,

Tomek

----
Publish on Gallery 3 (WLPG) | Modules: XMP, OpenID

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Thu, 2012-12-06 21:41

Instead of starting a new thread, I'm just going to bump this with a related question.

I tried to overwrite modules/gallery/views/error_404.html.php by copying it and changing the text (and some other things) into modules/openid/views/error_404.html.php

However, new page is not being loaded. Is this due to module precedence? Is there a way to fix this?

Thanks!

----
Publish on Gallery 3 (WLPG) | Modules: XMP, OpenID