Jump to content

Unwanted path replacement in own admin pages


Andudi
 Share

Recommended Posts

dear devs

I try to add some pages to the admin path, e.g. at "/processwire/subadmin/" for some subadmin stuff.

I do not give this page a process to keep it simple, but I want to use my own template like "subadmin" that I can control the access with a role for some users.

The problem now is that "/processwire/subadmin/" is automatically replaced from the LanguageSupportPageNames module with "/de/processwire/subadmin/" (de is my default language) and this is not what I wanted.

Digging the modules code, I found in the file:

    pw2.6.21/wire/modules/LanguageSupport/LanguageSupportPageNames.module

on line 226 why this path replacement is normally skipped for admin pages:

                if($page->template == 'admin') return '';
 

My proposition is now to add the following line after the $conifg definition at line 230:

               if ($page->rootParent->path == $config->urls->admin) return '';
 

Then, the replacement is only done for normal pages and not for pages under the admin path...  what do you think about that? or, how could I fix this with a simple module/hook trick?

And yes, when I use just no language string for the default language it works as well, but I hope to find an even better solution... thanks for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...