Problem/Motivation

When the endpoint is down, and you go to a direct link of a search result page (because someone gave it to you for example), you get a white page "unexpected error". The log shows why:

TypeError: Drupal\openwoo_search\Plugin\OpenWooSearch\OpenWooApp::getPublicationValues(): Argument #1 ($publication) must be of type object, null given, called in /var/www/testing.dvgemdemo.hosted-temp.com/releases/20240502142349-test-2358330/htdocs/modules/contrib/openwoo/modules/openwoo_search/src/Plugin/OpenWooSearch/OpenWooApp.php on line 174 in

Steps to reproduce

Hard to reproduce, but add a check if the $publication is an object to catch this error.
You can reproduce some of it by finding a real serach result page, and than changing the endpoint to an endpoint the publication is not available on and the api key is not accepted on.

Issue fork openwoo-3445009

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

JoshaHubbers created an issue. See original summary.

joshahubbers’s picture

Issue summary: View changes

* Added a catch to handle responses other than 200
* Added some catches to prevent php warnings for not sending a string into json_decode

joshahubbers’s picture

Status: Active » Needs review
perry.franken’s picture

Status: Needs review » Reviewed & tested by the community
perry.franken’s picture

Status: Reviewed & tested by the community » Fixed

  • perry.franken committed e4e360b0 on feature/DVGEM-5662_DVGEM-5812_simple-pager authored by JoshaHubbers
    Issue #3445009 by JoshaHubbers, perry.franken: Error management when...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.