thetuningspoon Posted December 21, 2012 Share Posted December 21, 2012 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 More sharing options...
ryan Posted December 22, 2012 Share Posted December 22, 2012 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 More sharing options...
thetuningspoon Posted December 24, 2012 Author Share Posted December 24, 2012 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 More sharing options...
ryan Posted December 24, 2012 Share Posted December 24, 2012 Like you probably saw, the upgrade is primarily just a matter of replacing your /wire/ directory with the new one. Let us know if the upgrade helped to solve the issue? Link to comment Share on other sites More sharing options...
thetuningspoon Posted December 26, 2012 Author Share Posted December 26, 2012 Hi Ryan, I upgraded to version 2.2.9 by using the profile exporter and creating a new database. Still cannot access the roles. Not sure where to go from here. I've done quite a bit of work in this profile so starting from scratch isn't really a feasible option. Link to comment Share on other sites More sharing options...
apeisa Posted December 26, 2012 Share Posted December 26, 2012 Do you have any custom modules installed? Especially autoload modules. Or have you edited admin theme? Link to comment Share on other sites More sharing options...
thetuningspoon Posted December 26, 2012 Author Share Posted December 26, 2012 I had some custom modules but I uninstalled. Same issue. Another detail-- I can add new roles but they don't show up as checkbox options when I go to edit a user. I have 5 roles listed as options for each user, but 7 listed on the Roles page. Link to comment Share on other sites More sharing options...
Soma Posted December 26, 2012 Share Posted December 26, 2012 Make sure you published the roles as they wont show up otherwise. Link to comment Share on other sites More sharing options...
thetuningspoon Posted December 26, 2012 Author Share Posted December 26, 2012 Soma, I can't get that far since I just get sent back to the Pages tab when I click on a role or create a new one. Link to comment Share on other sites More sharing options...
apeisa Posted December 27, 2012 Share Posted December 27, 2012 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 More sharing options...
thetuningspoon Posted December 27, 2012 Author Share Posted December 27, 2012 The admin theme is the default. Would it help if provide the login? Thanks for everyone's help. It's looking like I'm going to have to bite the bullet and start from scratch. Link to comment Share on other sites More sharing options...
Soma Posted December 27, 2012 Share Posted December 27, 2012 Sure a login would help. I'm sure it's something simple. Link to comment Share on other sites More sharing options...
ryan Posted December 27, 2012 Share Posted December 27, 2012 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 More sharing options...
thetuningspoon Posted December 27, 2012 Author Share Posted December 27, 2012 I just did a fresh install of PW elsewhere (no profile) on the server and there's no issue with the roles. I'm thinking there's some sort of database issue. I'll PM you a dump of the database. Thanks so much for your willingness to help, Ryan. Link to comment Share on other sites More sharing options...
ryan Posted December 28, 2012 Share Posted December 28, 2012 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. 2 Link to comment Share on other sites More sharing options...
thetuningspoon Posted December 28, 2012 Author Share Posted December 28, 2012 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! 1 Link to comment Share on other sites More sharing options...
Soma Posted December 28, 2012 Share Posted December 28, 2012 Edit template -> family tab there you can specify various settings to restrict children templates. Link to comment Share on other sites More sharing options...
thetuningspoon Posted December 28, 2012 Author Share Posted December 28, 2012 That's where I expected to see it, but I don't see an option for a default child template. Maybe I'm thinking of an extension that added this capability? Link to comment Share on other sites More sharing options...
apeisa Posted December 28, 2012 Share Posted December 28, 2012 There isn't such a thing, at least yet. But if you allow only one template then it is assumed. 1 Link to comment Share on other sites More sharing options...
ryan Posted December 29, 2012 Share Posted December 29, 2012 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 More sharing options...
thetuningspoon Posted January 2, 2013 Author Share Posted January 2, 2013 Ahhh, okay. That makes sense. Thanks! Link to comment Share on other sites More sharing options...
jimmy Posted April 29, 2020 Share Posted April 29, 2020 Im on 3.0.155 and still are able to create a new role named "edit". thereby replicating the issue mentioned above. glad to have found this post! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now