Skip to content

fixed exception when a non-existant bib record is attempted to be loaded #187

Open
lauriek334 wants to merge 1 commit intomasterfrom
fixException-loadingBibNotInCatalog
Open

fixed exception when a non-existant bib record is attempted to be loaded #187
lauriek334 wants to merge 1 commit intomasterfrom
fixException-loadingBibNotInCatalog

Conversation

@lauriek334
Copy link
Contributor

Exception being thrown:
PHP message: Uncaught PHP Exception Error: "Attempt to assign property "_id" on null at /var/www/drupal10/web/modules/custom/arborcat/src/Controller/DefaultController.php line 61" while reading response header from upstream, client: 10.0.9.41, server: dev.aadl.org, request: "GET /catalog/record/ibib-100059602 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "dev.aadl.org"

Passing a non existant bibID causes the exception. You can observe it on dev and production - here:
http://dev.aadl.org/catalog/record/ibib-100059602
http://aadl.org/catalog/record/ibib-100059602

Fix:
initialized bib_record before the try/catch
to avoid confusion, renamed $json variable to $response_object as json_decode method returns a PHP object. Test bib to load: https://aadl.org/catalog/record/ib-100010008

Tested locally and on dev.

…ib record is not in the catalog.

initialized bib_record before the try/catch
to avoid confusion, renamed $json variable to $response_object as json_decode method returns a PHP object.
Test bib to load: https://aadl.org/catalog/record/ib-100010008
@lauriek334 lauriek334 requested review from ejk and taleon December 6, 2023 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments