Workboard 404 after using "View as Query"


#1

Observed Behavior:
After clicking “View as Query” on a workboard column (where the workboard has a customized default filter), the workboard will return a 404.

Expected Behavior:
Returning a 200 and showing the workboard.

Phabricator Version:
rP8ab7859d85cc3bd0ef3ebc25bd26026efc3931b8
rARCf5e65a808e21710fb3818842d5e0b52a0f67c387
rPHU014e3569b2e01056e69e4c51c2c40b14e3059091

Reproduction Steps:

  1. Create a new project.
  2. Create the workboard for the new project.
  3. Change the default workboard filter (it has to be a custom query rather than one of the built-in ones, I changed it to tasks assigned to myself).
  4. On the “backlog” column, click “View as Query”.
  5. Click “Search”.
  6. Go back to workboard page, get 404ed.

#2

From my own troubleshooting (this has happened twice now on our install), the saved query referenced in workboard.filter.default seems to no longer exist. The 404 is then caused by this code:

$custom_query = null;                                                        
if ($search_engine->isBuiltinQuery($query_key)) {                            
  $saved = $search_engine->buildSavedQueryFromBuiltin($query_key);           
} else {                                                                     
  $saved = id(new PhabricatorSavedQueryQuery())                              
    ->setViewer($viewer)                                                     
    ->withQueryKeys(array($query_key))                                       
    ->executeOne();                                                          
                                                                             
  if (!$saved) {                                                             
    return new Aphront404Response();                                         
  }                                                                          
                                                                             
  $custom_query = $saved;                                                    
}

#3

I don’t know if it is related, but downstream https://phabricator.wikimedia.org/T199207 came to my mind.


#4

Upstreamed as https://secure.phabricator.com/T13208 since we now have three independent reports.