mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix Phriction document migration after project magic removal
Summary: See <https://github.com/phacility/phabricator/issues/760>. We removed these methods in D10832 but still need the migration to be able to do project checks. Test Plan: Ran on a test wiki with `/`, `/projects/` and `/projects/example/`. The first two pages didn't try to use project policies; the third one did. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10836
This commit is contained in:
parent
755c518631
commit
ac87ab275a
1 changed files with 9 additions and 4 deletions
|
@ -16,11 +16,16 @@ foreach (new LiskMigrationIterator($table) as $doc) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// project documents get the project policy
|
||||
if (PhrictionDocument::isProjectSlug($doc->getSlug())) {
|
||||
// If this was previously a magical project wiki page (under projects/, but
|
||||
// not projects/ itself) we need to apply the project policies. Otherwise,
|
||||
// apply the default policies.
|
||||
$slug = $doc->getSlug();
|
||||
$slug = PhabricatorSlug::normalize($slug);
|
||||
$prefix = 'projects/';
|
||||
if (($slug != $prefix) && (strncmp($slug, $prefix, strlen($prefix)) === 0)) {
|
||||
$parts = explode('/', $slug);
|
||||
$project_slug = $parts[1].'/';
|
||||
|
||||
$project_slug =
|
||||
PhrictionDocument::getProjectSlugIdentifier($doc->getSlug());
|
||||
$project_slugs = array($project_slug);
|
||||
$project = id(new PhabricatorProjectQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
|
|
Loading…
Reference in a new issue