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)
Mon, Apr 1, 7:46 AM
Unknown Object (File)
Wed, Mar 27, 5:17 PM
Unknown Object (File)
Feb 9 2024, 3:42 AM
Unknown Object (File)
Jan 27 2024, 9:46 AM
Unknown Object (File)
Dec 26 2023, 7:09 PM
Unknown Object (File)
Dec 21 2023, 10:08 AM
Unknown Object (File)
Dec 17 2023, 9:21 PM
Unknown Object (File)
Nov 30 2023, 4:23 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
Branch
export1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24664
Build 34009: Run Core Tests
Build 34008: arc lint + arc unit