Any ideas why clicking the "Show Diff" button on the back-end switches themes to my front-end theme? FWIW, the changes are displayed perfectly, I just can't figure out why they're not just shown in the back-end theme (Seven).

Comments

realityloop’s picture

Status: Active » Postponed (maintainer needs more info)

Can you paste the respective URLs that are displayed?

Also if you vcould test if this still happens with the Dev release it would be appreciated

michaelgiaimo’s picture

Sure. I go from here:

http://mydomain.com/drupal/?q=node/30546/revisions

to here, by clicking on "Show Diff" button.

http://mydomain.com/drupal/?q=node/30546/revisions/view/100372/100373

Again, the Diff part is working - it shows the color-coded side-by-side changes. It's just in my front end for some reason.

michaelgiaimo’s picture

Version: 7.x-2.0-beta2 » 7.x-2.x-dev

And so very sorry - this was the Dev release. Updated issue.

michaelgiaimo’s picture

Any ideas?

michaelgiaimo’s picture

Priority: Normal » Critical
michaelgiaimo’s picture

Status: Postponed (maintainer needs more info) » Active
realityloop’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

do you have editing set to use the front end theme?

michaelgiaimo’s picture

Status: Postponed (maintainer needs more info) » Active

I have the box checked to have editing use the Admin theme with Content editing.

Diff is awesome, and track changes was absolutely mission critical for a project I'm working on - so for now, and in case anyone else has this issue, I installed this module:

http://drupal.org/project/admin_theme

And it's working. This of course could be done with a custom function using a menu hook, but this module gives a nice gui to it.

mariusz.slonina’s picture

http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...

I think the module should implement this hook for *revisions* paths.

realityloop’s picture

Status: Active » Fixed

Added, should be in next dev release

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dozenson’s picture

I'm using the latest dev version and diff_admin_paths_alter has no effect.
I replaced it with hook_admin_paths as mariusz.slonina suggested and this did the trick

/**
 * Implements hook_admin_paths().
 */

function diff_admin_paths() {
  $paths = array(
    'node/*/revisions/view/*/*' => TRUE,
  );
  return $paths;
}
elijah lynn’s picture

Status: Closed (fixed) » Active

I am having this issue on 7.x-2.0.

mitchell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Active » Postponed (maintainer needs more info)

Please test with the latest 7.x-3.x branch and report back.

Please also investigate if this problem is caused by Admin Theme.

alan d.’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

@Elijah Lynn
This should be fixed in 2.x branch as per Brains comment in #10 and new issues arising from this have been addressed in 3.x (i.e. the admin theme enforcement is configurable)

broon’s picture

Just for other user experiencing a similar behavior.

I was using 7.x-3.2 and Admin theme 7.x-1.0.
While admin theme was used for administrators, diff changed to front-end theme for other users (e.g. content manager).

I did add the paths to Appearance (/admin/appearance) >> Adminsitration Theme >> Pages >> Custom

node/*/moderation/diff
node/*/moderation/diff/view/*/*

and at /admin/config/content/diff/entities I checked the option "Treat diff pages as administrative".

However, the diff pages were still displayed differently for various user roles.
Using both modules, you have to give the permission of using the admin theme to respective user roles.

alan d.’s picture

@Paul
Being a crusty old Drupal developer, I've assumed that permissions to access the admin theme was a known thing. So should the description be updated in the Diff settings to point this out?

Something like:

$admin_permissions_link = user_access('administer permissions') ? l(t('View the administration theme'), 'admin/people/permissions', array('fragment' => 'edit-view-the-administration-theme')) : t('View the administration theme');

-    '#description' => t('Diff pages are treated as administrative pages by default, although it is up to each module to enforce this and to implement this optional setting.'),
+    '#description' => t('Diff pages are treated as administrative pages by default, although it is up to each module to enforce this and to implement this optional setting. Users need to have the permission "!access_link" for this setting to have any effect.', array('!permissions_link' => $admin_permissions_link)),

Rendering something like this:

Diff pages are treated as administrative pages by default, although it is up to each module to enforce this and to implement this optional setting. Users need to have the permission "View the administration theme" for this setting to have any effect.

broon’s picture

From my personal experience of only four years of Drupal development, I experienced a lot of situations in which the permission system is not very intuitive. And the vast majority of my clients' questions can be solved by some permission settings (ever worked on a Drupal site with Node Access and Organic Groups and tried to explain your customer why (s)he has to change permissions in three different places in order to display one new field?).

So yes, I would always try to include advise on which permissions are necessary.

In the special case above for example, some might get crazy as there is the Drupal core permission "System >> View the administration theme" (which you included in your patch) as well as "Administration theme >> Access administration theme" (which I was referring to). It can easily be missed that a role needs both permissions if both Diff and Admin theme are installed.

alan d.’s picture

I actually thought Administration theme was dropped with core inclusion. Guess you learn something new everyday.

cross-posting #1970872: Add permissions help for admin theme setting - I'll leave it open for a while to get more feedback, but personally I think it is a handy enhancement.

broon’s picture

Administration theme has been included in core, that's right, but it only works for admin pages (and yes, one might think that's induced by its title). Other modules can define their own pages to be treated as admin pages, just as Diff now does. However, there are still some modules that don't and then you can still install the D7 version of Administration theme.

The actual problem probably came up when upgrading from Diff 2 to Diff 3. While my Diff 2 pages were treated as admin pages by using Administration theme, there is no need when using Diff 3. But the Diff paths were still set as admin with Administration theme. So in fact, the Diff pages are now "double-admin", hence one needs both permissions for the Diff pages eventually be displayed with admin theme.