Hi,
I am using admin_theme 6.x version with openpublish 2.3 .My admin theme is set to "Rubik" and for front end I am using a customized theme. when I open create article form then it displays with Rubik theme but when I submit this form without title value then it return with "Title field is required" error and admin theme "Rubik" is gone now and my custom theme is appeared in article form.
I have even set these value in custom pages (admin theme setting) :
node/add/*
node/edit/*

Is there any way to keep Admin theme for content form in any conditions:
Any help is much appreciated.

Thanks
Subhash

Comments

subu.purohit’s picture

Ok I got the solution. for this I created a new module "admintheme" and put following code snippet in it:

function admintheme_init() {
    global $custom_theme;
   
    if (arg(0) == 'node' && ((arg(1) == 'add') || (arg(2) == 'edit' ))) {
        $custom_theme = variable_get('admin_theme', 0);
        init_theme();
    }
}

I know there might be better solution for this. but right now it works for me. For better reference you can go to this: http://drupal.org/node/324004

Thanks
Subhash

jrstmartin’s picture

OMG, you are the best! I am not alone! This very problem had me stumped for a while. I actually turned to the Ajax module in order to "fix" the unsightly problem - that module caused other problems for me though. Thanks so much for posting your fix.

Also note that whatever module you add this function to, the module weight in the system table should be zero. My glue module was at 10 and this function fails to work in that case.

Steve Dondley’s picture

I actually had to set my custom module's weight to -1 to get this working. Thanks for mentioning the module weight though else I wouldn't have thought to change that.

justy’s picture

Issue summary: View changes

Closing this old Drupal 6 issue.

justy’s picture

Status: Active » Closed (outdated)