Page MenuHomePhabricator

Fix an issue where "Export Data" could fail if a user had a nonempty custom policy preference
ClosedPublic

Authored by epriestley on Jun 16 2020, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 9:55 AM
Unknown Object (File)
Wed, Dec 18, 11:38 PM
Unknown Object (File)
Mon, Dec 16, 4:13 AM
Unknown Object (File)
Thu, Dec 5, 9:52 PM
Unknown Object (File)
Tue, Nov 26, 7:46 PM
Unknown Object (File)
Nov 23 2024, 2:57 AM
Unknown Object (File)
Nov 22 2024, 10:28 AM
Unknown Object (File)
Nov 18 2024, 8:36 AM
Subscribers
None

Details

Summary

The "Export Data" workflow incorrectly uses the "Policy Favorites" setting to choose a default export format. This is just a copy/paste error; the correct setting exists and is unused.

If the setting value is an array (as the "Policy Favorites" value often is), we try to use it as an array index. This generates a runtime exception after D21044.

[2020-06-16 06:32:12] EXCEPTION: (RuntimeException) Illegal offset type in isset or empty at [<arcanist>/src/error/PhutilErrorHandler.php:263]
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:460]
  • Use the correct setting.
  • Make sure the value we read is a string.
Test Plan
  • Used "Export Data" with a nonempty, array-valued "Policy Favorites" setting.
    • Before: runtime exception.
    • After: clean export.
  • Used "Export Data" again, saw my selection from the first time persisted.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable