Page MenuHomePhabricator

pfautocomplete API documentation provides an SMW property as an example, which generates an error if SMW is not installed
Closed, ResolvedPublic

Description

https://lol.gamepedia.com/api.php?action=help&modules=pfautocomplete

Example #2 links to https://lol.gamepedia.com/api.php?action=pfautocomplete&substr=te&property=Has_author
which generates an internal server error since SMW is not installed. It would be better to more gracefully handle this (or not show the example if SMW is not installed)

[4c49d41610fa9b005fc9e91c] /api.php?action=pfautocomplete&substr=te&property=Has_author Error from line 198 of /home/hydra/public_html/extensions/PageForms/includes/PF_AutocompleteAPI.php: Class 'SMWPropertyValue' not found
Backtrace:
#0 /home/hydra/public_html/extensions/PageForms/includes/PF_AutocompleteAPI.php(53): PFAutocompleteAPI::getAllValuesForProperty(string, string)
#1 /home/hydra/public_html/includes/api/ApiMain.php(1579): PFAutocompleteAPI->execute()
#2 /home/hydra/public_html/includes/api/ApiMain.php(535): ApiMain->executeAction()
#3 /home/hydra/public_html/includes/api/ApiMain.php(506): ApiMain->executeActionWithErrorHandling()
#4 /home/hydra/public_html/api.php(94): ApiMain->execute()
#5 {main}

Event Timeline

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

Good point - I didn't think about that. I just checked in what I think is a fix for this.