Fix exposers to new API response

This commit is contained in:
Leo Germani 2019-05-28 11:45:08 -03:00
parent e11f6bd8a0
commit 902b860fd4
3 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ class Csv extends Exposer {
);
$items = $response->get_data();
$items = is_array($items) && isset($items['items']) ? $items['items'] : [];
if (sizeof($items) > 0) {

View File

@ -27,6 +27,7 @@ class Html extends Exposer {
$response->set_headers( ['Content-Type: text/html; charset=' . get_option( 'blog_charset' )] );
$items = $response->get_data();
$items = is_array($items) && isset($items['items']) ? $items['items'] : [];
$html = '
<!DOCTYPE html>

View File

@ -181,7 +181,7 @@ class OAIPMH_List_Records extends OAIPMH_Expose {
foreach ($maps as $key => $val) {
if( $val && is_object($val) )
$this->xml_creater->addChild($this->working_node, $key, html_entity_decode($val->get_value()));
$this->xml_creater->addChild($this->working_node, $key, html_entity_decode($val->get_value_as_string()));
else
$this->xml_creater->addChild($this->working_node, $key, '');
}