Page MenuHomePhorge

Fix "Undefined index: icon" when visiting Search Servers using MySQL
ClosedPublic

Authored by valerio.bozzolan on Feb 28 2023, 09:39.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 01:11
Unknown Object (File)
Sat, Apr 6, 17:25
Unknown Object (File)
Mon, Apr 1, 08:38
Unknown Object (File)
Mon, Apr 1, 00:52
Unknown Object (File)
Mon, Apr 1, 00:52
Unknown Object (File)
Mon, Apr 1, 00:52
Unknown Object (File)
Thu, Mar 28, 00:52
Unknown Object (File)
Wed, Mar 27, 18:25
Tokens
"Love" token, awarded by valerio.bozzolan.

Details

Summary

Fix "Undefined index: icon" when visiting Search Servers using MySQL

NOTE: This patch just fixes the exception at my best but this section probably deserves more improvement to show a better default.

Closes T15155

Test Plan
  • use the default Search Server configuration (that is MySQL)
  • open the page Search Servers (/config/cluster/search/)
  • verify that it does not explode anymore but it displays something unuseful

Diff Detail

Repository
rP Phorge
Branch
T15155-fix-search-servers-array-status-icon
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 121
Build 121: arc lint + arc unit

Event Timeline

This is how it will render after this change:

Phorge Search Servers with MySQL without exception.png (367×456 px, 24 KB)

It's just something to avoid that exception.

It can surely improve saying that it's "Active" but it's probably not appropriate to assume this positive status condition in this position, and so any further improvement about the status itself is probably out of the scope of this fix and should be put in the getConnectionStatus() method maybe.

src/applications/config/controller/services/PhabricatorConfigClusterSearchController.php
78
NOTE: I'm not very happy about the fact that here we are, in a single line, creating the array and assigning the first value.

But I think it's out of the scope of this patch to improve that part.

avivey subscribed.

Thanks - this logic could use some more love, as you say.

This revision is now accepted and ready to land.Mar 3 2023, 10:33