Hi,
We are using the themekey module to determine the themes for some node types. The other node types use the admin theme rootcandy as the admin theme is also set to be the content editing theme from "admin/settings/admin". But the patch introduced at the issue "Display node/%/revisions/%/edit pages in site admin theme" [0] is always setting the theme of all node edit forms to the admin theme. So the presence of revisioning is rendering themekey useless :-( Some kind of revisioning module settings about theme manipulation would be great. Would you be happy to entertain such a patch if I provide one?

Thanks,
Adnan

[0] http://drupal.org/node/459986

Comments

rdeboer’s picture

Absolutely!
All patches welcome.
Rik

progga’s picture

StatusFileSize
new2.39 KB

Hi,
I have attached the patch. This patch adds a checkbox in the settings page (i.e. admin/settings/revisioning). When this checkbox is NOT checked, _revisioning_edit() and revisioning_edit_revision() will NOT attempt to change any themes. By default, the checkbox is checked. So the behavior for existing sites will remain the same.

If you want me to setup some kind of test site for this then do let me know.

The patch is against 6.x-3.x instead of 6.x-3.12.

Thanks,
Adnan

rdeboer’s picture

Thanks progga!
Patch looks good.
Will apply for next version.
Rik

mkalkbrenner’s picture

I don't understand the problem exactly because I don't know Revisioning module yet.

But getting a path like "node/%/revisions/%/edit" into ThemeKey itself is very easy. We did the same for other modules, p.e print:

/**
 * Implements hook_themekey_paths().
 */
function themekey_print_themekey_paths() {
  $paths = array();

  $paths[] = array('path' => 'print/#node:nid');
  $paths[] = array('path' => 'printpdf/#node:nid');
  $paths[] = array('path' => 'printmail/#node:nid');

  return $paths;
}

That's all we had to do to integrate both modules.

From revisioning.module I assume these paths will do:

node/%node/unpublish
node/%node/revisions/%vid/view
node/%node/revisions/%vid/edit
node/%node/revisions/%vid/publish
node/%node/revisions/%vid/unpublish
node/%node/revisions/%vid/revert
node/%node/revisions/%vid/delete
node/%node/revisions/%vid/compare

If agree, it will take me just a few minutes to get this into ThemeKey itself.

mkalkbrenner’s picture

Integration / support of Revisioning module committed to ThemeKey. It would be nice if someone tests it.

rdeboer’s picture

Even better, Markus!

progga’s picture

Actually, the problem is not with any specific paths. _revisioning_edit() and _revisioning_edit_revision() overwrites the "$custom_theme" global variable when a node edit page or node revision page is opened respectively. So any value assigned to "$custom_theme" earlier from themekey_init() gets lost when any of these functions are called :-(

I have tried to test Markus' latest update in the following way:

  1. git clone --branch 6.x-3.x http://git.drupal.org/project/themekey.git
  2. rsync -r --delete themekey/ /path/to/themekey/in/local/site/
  3. Open "admin/settings/themekey" and then save it. This results in the execution of themekey_rebuild().
  4. Open "node/N/edit" where node # N is of type "foo". "foo" has a "node:type" rule set in "admin/settings/themekey" for the theme "Bar".
  5. Still seeing Rootcandy instead of "Bar" :-(

Thanks,
Adnan

rdeboer’s picture

Status: Active » Closed (cannot reproduce)

Not sure. Nobody has cared for nearly 4 months.... closing.