Commit d06c1e1f authored by efalcy's avatar efalcy Committed by Sebastien ANDRE
Browse files

hotline#139058: fix loan history board when no album

parent 64173db2
- ticket #139058 : Administration : Correction de l'affichage du tableau des prêts PNB
\ No newline at end of file
......@@ -175,12 +175,21 @@ class Class_Loan_Pnb extends Storm_Model_Abstract {
public function getGenres() {
return array_filter(array_map('trim', explode(';', $this->getAlbum()->getGenre())));
return ($album = $this->getAlbum())
? $this->_withAlbumDo(function () use ($album) { return $album->getGenre(); })
: [];
}
public function getSections() {
return array_filter(array_map('trim', explode(';', $this->getAlbum()->getSections())));
return ($album = $this->getAlbum())
? $this->_withAlbumDo(function () use ($album) { return $album->getSections(); })
: [];
}
protected function _withAlbumDo($callback) {
return array_filter(array_map('trim', explode(';', $callback())));
}
......
......@@ -156,6 +156,18 @@ class PnbDilicomAdminLoansHistoryWithDilicomGenreSectionAdminVar extends PnbDili
public function setUp() {
parent::setup();
Class_AdminVar::set('DILICOM_PNB_BOARD_DISPLAY_SECTION',1);
$this->fixture('Class_Loan_Pnb',
['id' => 33,
'record_origin_id' => 'Dilicom-with-no-matching-album',
'subscriber_id' => '000006',
'user_id' => 1,
'expected_return_date' => '2017-12-13 13:57:33',
'loan_date' => '2017-11-13 13:57:33',
'loan_link' => 'https://pnb-dilicom.centprod.com/v2//XXXXXXXX.do',
'order_line_id' => '12385',]);
$this->dispatch('/admin/pnb/loans?'
. http_build_query(['search_order' => 'loan_date',
'search_loan_date_debut' => '10/11/2017',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment