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
F15517968: D21361.diff
Sat, Apr 19, 9:50 AM
F15506255: D21361.id.diff
Tue, Apr 15, 9:47 AM
F15490942: D21361.id50845.diff
Fri, Apr 11, 9:53 PM
F15489325: D21361.id50846.diff
Fri, Apr 11, 7:57 AM
F15486038: D21361.id.diff
Thu, Apr 10, 4:28 AM
F15483205: D21361.diff
Wed, Apr 9, 10:41 AM
F15391717: D21361.id50845.diff
Mar 15 2025, 11:18 AM
Unknown Object (File)
Feb 21 2025, 9:21 PM
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