Jump to content

Cannot edit roles


thetuningspoon
 Share

Recommended Posts

Hey guys,

I was working in the access tab (ProcessWire 2.2.0) and suddenly I can no longer view or edit roles. Instead of taking me to the edit role page when I click on a role, it brings me back to the pages list and says "You are logged in." I logged out and back in again and tried an alternate browser but I'm still having the issue.

The original issue that I was having was that my site editors were unable to publish new pages, so I was looking for a fix for that when I came across this issue. I am logged in as a superuser and am using the default admin interface. Any ideas? Thanks.

Link to comment
Share on other sites

I've not heard of that particular issue before. But 2.2.0 is now a fairly old version, so you may want to upgrade it to the current stable (2.2.9), just in case.

Can you think of any changes that took place before it stopped working? What it sounds like to me is that PW does not fully see you as a superuser. The fact that you are getting that "you are logged in" message indicates it is detecting a lack of access to something and then sending you to the login page, and the login page is saying "you are already logged in". One thing you can try is to make sure you have the superuser role by adding it back from the API. Paste this bit of code into one of your template files and then view a page that uses it:

$you = $users->get('your-user-name'); 
$you->of(false);
$you->addRole('superuser'); 
$you->save(); 

Remember to remove it after executing it.

Link to comment
Share on other sites

Thanks Ryan, I'll give both suggestions a shot. Forgive me for asking if this is already documented on the site somewhere (I couldn't find it), but what is the recommended upgrade procedure?

Update: Setting the superadministrator through a template didn't solve the issue.

EDIT: Found the article on how to upgrade.

Link to comment
Share on other sites

I can think only two reasons for these things happening: either some security stuff from your host (you should contact them and ask if they have installed anything on date when it stopped working) or then some bad behaving autoload module (or admin theme).

Link to comment
Share on other sites

Have you tried installing to localhost or somewhere else, just to see if there is a host issue? Sometimes mod_security and related can cause some unusual things to happen. Because the behavior is unique and unusual, it does make me wonder about external factors at the host or even a potential database corruption. So you might try running a DB repair just in case. If you'd like, PM or email (ryan at this domain) a copy of the database (or the whole profile) and I can check it out.

Thanks for everyone's help. It's looking like I'm going to have to bite the bullet and start from scratch.

You definitely don't have to start from scratch.

Link to comment
Share on other sites

Thanks for sending the database. This helped me to track it down quickly. The issue was that you've got a role named "edit". Because roles themselves are just pages in the tree, that name is overriding the URL segment "edit" used by the module that lets you edit roles. It's attempting to literally load the page living at URL roles/edit/ rather than the role editor. I will find a way to prevent these from getting mixed up in the future. But for now, your best bet is to either delete or rename your role that is currently named "edit". The way to do this is to go edit the role from your Page List tree, rather than from the Access tab. i.e. click Pages > Admin > Access > Roles > edit, in the Page List tree. Rename it from "edit" to "editor" or something else if you prefer.

  • Like 2
Link to comment
Share on other sites

Thank you Ryan!! That fixed the issue. I didn't even realize I could get to the user roles through the page tree. Pretty cool stuff.

While I was doing some more work on the site I had another (hopefully much quicker) question: How do I set the default child page template for a given page and/or template? I seem to remember this being a feature that I used in the past but now I can't seem to locate it. I do love the ability to restrict the type of child pages from the template, however. Great feature!

  • Like 1
Link to comment
Share on other sites

Antti is correct that it is assumed as the default template when you only allow one. If you select more than one, then it will allow any of them to be used, but will select a default for new pages based on whatever the last child used.

Link to comment
Share on other sites

  • 7 years later...

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...