@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Probably (?) fix two very old project slug migrations

Summary: Fixes T12020. These callsites to `getPhrictionSlug()` were missed when that method was removed. They're very old (early 2014, late 2011).

Test Plan:
These are tricky to test because the migrations are so ancient, but `bin/storage upgrade --force --apply phabricator:20140521.projectslug.2.mig.php` gave me //plausible// results.

The other migration is so ancient that it can't apply to a modern database so I'm just kind of winging that one. We probably have essentially no installs which will ever apply it again, though.

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T12020

Differential Revision: https://secure.phabricator.com/D17060

+11 -6
+8 -5
resources/sql/autopatches/20140521.projectslug.2.mig.php
··· 4 4 $table_name = $project_table->getTableName(); 5 5 $conn_w = $project_table->establishConnection('w'); 6 6 $slug_table_name = id(new PhabricatorProjectSlug())->getTableName(); 7 - $time = time(); 7 + $time = PhabricatorTime::getNow(); 8 8 9 - echo pht('Migrating project phriction slugs...')."\n"; 9 + echo pht('Migrating projects to slugs...')."\n"; 10 10 foreach (new LiskMigrationIterator($project_table) as $project) { 11 11 $id = $project->getID(); 12 12 13 13 echo pht('Migrating project %d...', $id)."\n"; 14 - $phriction_slug = rtrim($project->getPhrictionSlug(), '/'); 14 + 15 + $slug_text = PhabricatorSlug::normalizeProjectSlug($project->getName()); 15 16 $slug = id(new PhabricatorProjectSlug()) 16 - ->loadOneWhere('slug = %s', $phriction_slug); 17 + ->loadOneWhere('slug = %s', $slug_text); 18 + 17 19 if ($slug) { 18 20 echo pht('Already migrated %d... Continuing.', $id)."\n"; 19 21 continue; 20 22 } 23 + 21 24 queryfx( 22 25 $conn_w, 23 26 'INSERT INTO %T (projectPHID, slug, dateCreated, dateModified) '. 24 27 'VALUES (%s, %s, %d, %d)', 25 28 $slug_table_name, 26 29 $project->getPHID(), 27 - $phriction_slug, 30 + $slug_text, 28 31 $time, 29 32 $time); 30 33 echo pht('Migrated %d.', $id)."\n";
+3 -1
resources/sql/patches/090.forceuniqueprojectnames.php
··· 96 96 if ($other->getID() == $project->getID()) { 97 97 continue; 98 98 } 99 - if ($other->getPhrictionSlug() == $new_slug) { 99 + 100 + $other_slug = PhabricatorSlug::normalizeProjectSlug($other->getName()); 101 + if ($other_slug == $new_slug) { 100 102 $okay = false; 101 103 break; 102 104 }