Mostly a bot issue but with the various things we might remove over time I'm sure some patrons run into the server error
When a bib doesn't exist it tries to deal with the exception but $bib_record i don't think exists
PHP message: Uncaught PHP Exception Error: "Attempt to assign property "_id" on null" at /var/www/aadlorg/web/modules/custom/arborcat/src/Controller/DefaultController.php line 67"
|
// Get Bib Record from API |
|
$guzzle = \Drupal::httpClient(); |
|
try { |
|
$json = json_decode($guzzle->get($get_url)->getBody()->getContents()); |
|
if ($get_record_selector == 'harvest') { |
|
$bib_record = $json->bib; |
|
$bib_record->_id = $json->_id; |
|
} |
|
else { |
|
$bib_record = $json; |
|
} |
|
// Copy from Elasticsearch record id to same format as CouchDB _id |
|
//$bib_record->_id = $bib_record->id; |
|
$bib_record->id = $bib_record->_id; |
|
} catch (\Exception $e) { |
|
$bib_record->_id = NULL; |
|
} |
Mostly a bot issue but with the various things we might remove over time I'm sure some patrons run into the server error
When a bib doesn't exist it tries to deal with the exception but
$bib_recordi don't think existsPHP message: Uncaught PHP Exception Error: "Attempt to assign property "_id" on null" at /var/www/aadlorg/web/modules/custom/arborcat/src/Controller/DefaultController.php line 67"arborcat/src/Controller/DefaultController.php
Lines 52 to 68 in 00ed786