| Project: | CustomError |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | anil614sagar |
| Status: | patch (to be ported) |
Issue Summary
One should be able to have different themes or have the default theme on the error pages.
It seems strange when you have an admin theme, and different system theme, when some anonymous or authenticated users try to access an admin page which they have no access too, and get a different theme than the one they are currently using.
Since the system will set the admin theme as default on every path that has /admin/* path.
You can see the difference when trying to access an drupal site on a 404 or 403 page on local site which has 2 different theme for the admin and system.
I have added 2 patch files which adds the option to add a theme for each error_page, one is for drupal 6.x and the other id drupal 5.x.
| Attachment | Size |
|---|---|
| customerror.module.5.0.patch | 2.42 KB |
| customerror.module.6.0.patch | 1.79 KB |
Comments
#1
New Patches, missing
global $custom_themein the files, for overriding the default theme.#2
Did you test this?
$custom_theme = variable_get('customerror_' . $error_code . '_theme', ($error_code == 403 ? variable_get('admin_theme', 0) : 0));if (!empty($theme)) {
$custom_theme = $theme;
How is the above code supposed to work? Who will set the variable $theme?
Also, please do not use tabs and revise the code style to conform with Drupal's code style guidelines.
#3
Sorry a typo in the patch it should read>>
$theme = variable_get('customerror_' . $error_code . '_theme', ($error_code == 403 ? variable_get('admin_theme', 0) : 0));if (!empty($theme)) {
$custom_theme = $theme;
}
For the 5.0 patch the 6.0 patch is as it shoudl be yes teste both v6 and v5 on drupal 6 an5 respectively.
Essentially if system default is selected for both do nothing which resulting in use of the "admin theme" for 403 pages. And the system theme for 404 pages.
#4
Why should the 403 have the admin theme by default? This is not backwards compatible with the existing behavior and can be confusing and even ugly for sites that have a nice custom theme but use garland or plain zen for admin.
Also, the code is obscure, which means it is not easy to maintain.
I refactored the D5 version in the attached. Please review and test.
#5
Thanks for the refactoring :-)
I did not mean that all
403pages have theadmin theme.But the default behaviour of drupal is that it uses the
admin themeon the pages havingadminin the start of thepath.Adding a couple of screenshots.
Added a temp site for d6 on my machine the
default themeispushbuttonand theadmin themeisgarland.This is what happens on the pages when accessing 404 and a 403.
#6
I'd love this feature, and the patch here doesn't apply against the current version.
#7
I too would like to see this feature applied, as I use two different themes for admin/non-admin sections.
#8
Here is a patch against 6.x-dev version with code in #1 and #4 combined.
#9
Sorry, a revised version of #8. Please review.
#10
The patch at #4 no longer works. Is this working in the 5.x dev release?
#11
Just tested 5.x dev and it doesn't have the patch. I've tried manually applying code from #4 but too much has changed. Does anyone have an old version of custom error from around July, 2008 ? It isn't listed in the previous releases.
#12
I'm just chiming in here to say the patch in #8 works great for me and resolves the 'admin theme on 403/404 pages' issue. Thanks! It'd be great if the patch was incorporated into the module.
#13
Committed the patch in #9 to 6.x-1.x-dev. Should be in the tarball in a few hours.
Thanks to all.
#14
This isn't fixed for 5.x branch
#15
I am not maintaining the 5.x branch actively anymore.
However, if someone wants, they could test the patch of 5.x and verify that it is working, or reroll it if it is not, and I will commit it once it is verified working on that branch.
#16
I hope you are still working on this, as I cannot get any of these patches to work for me.
I might be a little green behind my Drupal-ears, but here goes (any understanding and help is deeply appreciated):
After I installed the module I copied the patch to the customerror module folder and opened a console and went to the customerror module path.
Then (for the #8 patch) I ran 'patch customerror.module customerror-drupal6-278575-8.patch' and it responded with:
Hunk #3 succeeded at 165 with fuzz 2 (offset 1 line)
Hunk #4 succeeded at 275 (offset -7 lines)
I get the 'Theme' selection option in '/admin/settings/customerror', but the 403 theme remains the admin theme and NOT the selected theme.
I tried to disable/enable the module as well but it didn't help.
I wonder if there is missing a part somewhere and what it should look like :S
#17