Quote from: BobRay at Jul 30, 2013, 09:58 PM
I have a number of Access Policies that are not on that list. Some I created myself, some were created by extras like Quip or NewsPublisher, some I'm not sure about. Can you give us the names of the new Policies and created during the upgrade?
Sorry I was not terribly clear there, Bob. In retrospect, given scenarios like freejung's, I'm not sure I'm understanding what the upgrade script is doing in some cases. I am fairly certain, though, that it's not creating any new Access Policies. Just Access Policy Templates.
Let me give you an example.
The Access Policy named "Context" is not on that list I included in step 1 of my previous post. So the upgrade script creates a new Access Policy Template named "ContextTemplate" (even though there may be one with that name already) .. a concatenation of the Access Policy's name and "Template". Let's say the id of that new Access Policy Template is 7. It then updates the "Context" Access Policy assigning it a `template` of 7. The fix is to assign `template` back to whatever id points to the "proper" Access Policy Template for that Access Policy. Part of the trick, and why I haven't figured out how to script it yet, is determining which one that should be. Following that, the Access Policy Template id 7 which was created during the upgrade can be removed.
This is what it seems to do for any Access Policies not in that list I gave.
I discerned the above from
a) looking at the code in setup/includes/upgrade.install.php
b) seeing the problem in action on some affected sites
I made a pull request to fix that much of the upgrade bug itself, though it does not clean up or fix sites already affected.
https://github.com/modxcms/revolution/pull/550
All that said, there are a couple of things that I can't account for which leads me to believe I haven't nailed the problem completely.
1) users like freejung seeing no erroneously created Access Policy Templates, but having Access Policies with a `template` of 0
2) some Access Policies like "Media Source User" not prompting the upgrade script to create a "Media Source UserTemplate" Access Policy Template
It's all very strange and starts to make my head hurt
Quote from: BobRay at Jul 30, 2013, 09:58 PM
Finally, can we create a list of the bogus Policy Templates that are being created? That would help fix things and also make sure that we don't delete important Policy Templates.
Since many users have custom Access Policies that may have spawned new Access Policy Templates, it's impossible to come up with a list. One extra hint I can give is that erroneously created Access Policy Templates will not only be named based on the name of the Access Policies plus "Template", they will have the same description as the Access Policy. So as I look at an example here, an Access Policy Template named "Media Source AdminTemplate" with a description of "Media Source administration policy." is a dead giveaway.
Hopefully this helps clear up some of the confusion.
Any further insight, especially regarding behavior that does not fit my above description, would be most helpful.