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
F15391717: D21361.id50845.diff
Sat, Mar 15, 11:18 AM
Unknown Object (File)
Fri, Feb 21, 9:21 PM
Unknown Object (File)
Feb 9 2025, 9:39 AM
Unknown Object (File)
Feb 9 2025, 9:39 AM
Unknown Object (File)
Feb 9 2025, 9:39 AM
Unknown Object (File)
Feb 9 2025, 9:39 AM
Unknown Object (File)
Feb 1 2025, 8:32 PM
Unknown Object (File)
Jan 31 2025, 1:40 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