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

Add a setup warning about deprecated Maniphest policy configuration

Summary: Ref T10003. Give installs more warning about these changes.

Test Plan: Changed configuration, saw warning. Reset configuration, no warning.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10003

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

+68
+68
src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
··· 84 84 $issue->addPhabricatorConfig($key); 85 85 } 86 86 } 87 + 88 + $this->executeManiphestFieldChecks(); 87 89 } 88 90 89 91 /** ··· 300 302 301 303 return $ancient_config; 302 304 } 305 + 306 + private function executeManiphestFieldChecks() { 307 + $maniphest_appclass = 'PhabricatorManiphestApplication'; 308 + if (!PhabricatorApplication::isClassInstalled($maniphest_appclass)) { 309 + return; 310 + } 311 + 312 + $capabilities = array( 313 + ManiphestEditAssignCapability::CAPABILITY, 314 + ManiphestEditPoliciesCapability::CAPABILITY, 315 + ManiphestEditPriorityCapability::CAPABILITY, 316 + ManiphestEditProjectsCapability::CAPABILITY, 317 + ManiphestEditStatusCapability::CAPABILITY, 318 + ); 319 + 320 + // Check for any of these capabilities set to anything other than 321 + // "All Users". 322 + 323 + $any_set = false; 324 + $app = new PhabricatorManiphestApplication(); 325 + foreach ($capabilities as $capability) { 326 + $setting = $app->getPolicy($capability); 327 + if ($setting != PhabricatorPolicies::POLICY_USER) { 328 + $any_set = true; 329 + break; 330 + } 331 + } 332 + 333 + if (!$any_set) { 334 + return; 335 + } 336 + 337 + $issue_summary = pht( 338 + 'Maniphest is currently configured with deprecated policy settings '. 339 + 'which will be removed in a future version of Phabricator.'); 340 + 341 + 342 + $message = pht( 343 + 'Some policy settings in Maniphest are now deprecated and will be '. 344 + 'removed in a future version of Phabricator. You are currently using '. 345 + 'at least one of these settings.'. 346 + "\n\n". 347 + 'The deprecated settings are "Can Assign Tasks", '. 348 + '"Can Edit Task Policies", "Can Prioritize Tasks", '. 349 + '"Can Edit Task Projects", and "Can Edit Task Status". You can '. 350 + 'find these settings in Applications, or follow the link below.'. 351 + "\n\n". 352 + 'You can find discussion of this change (including rationale and '. 353 + 'recommendations on how to configure similar features) in the upstream, '. 354 + 'at the link below.'. 355 + "\n\n". 356 + 'To resolve this issue, set all of these policies to "All Users" after '. 357 + 'making any necessary form customization changes.'); 358 + 359 + $more_href = 'https://secure.phabricator.com/T10003'; 360 + $edit_href = '/applications/view/PhabricatorManiphestApplication/'; 361 + 362 + $issue = $this->newIssue('maniphest.T10003-per-field-policies') 363 + ->setShortName(pht('Deprecated Policies')) 364 + ->setName(pht('Deprecated Maniphest Field Policies')) 365 + ->setSummary($issue_summary) 366 + ->setMessage($message) 367 + ->addLink($more_href, pht('Learn More: Upstream Discussion')) 368 + ->addLink($edit_href, pht('Edit These Settings')); 369 + } 370 + 303 371 }