Commit aced8bda authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#77798_import_oai_gallica_ko' into 'hotline'

hotline : fix oai : search form and error when adding album

See merge request !2762
parents fe3c570f 162a01bf
Pipeline #4718 failed with stage
in 46 minutes and 37 seconds
- ticket #77798 : Administration : correction de l'import OAI.
\ No newline at end of file
......@@ -95,7 +95,9 @@ class Admin_OaiController extends ZendAfi_Controller_Action {
public function searchForm($expression) {
return $this->view
->newForm(array('id' => 'search'))
->setAction($this->view->url(array('action' => 'search')))
->setAction($this->view->url(['module' => 'admin',
'controller' => 'oai',
'action' => 'search'],null, true))
->setMethod('get')
->addElement('text', 'expression', array('label' => 'Rechercher dans le catalogue OAI',
'value' => $expression))
......@@ -104,14 +106,14 @@ class Admin_OaiController extends ZendAfi_Controller_Action {
public function importAction() {
$notice = Class_NoticeOAI::getLoader()->find($this->_getParam('id'));
$album = Class_Album::getLoader()->newInstance()
->beOAI()
->setTitre($notice->getTitre())
->setAuteur($notice->getAuteur())
->addEditor($notice->getEditeur())
->setAnnee($notice->getDate())
->setIdOrigine($notice->getIdOai());
$notice = Class_NoticeOAI::find($this->_getParam('id'));
$album = Class_Album::newInstance()
->beOAI()
->setTitre($notice->getTitre())
->addAuthor($notice->getAuteur())
->addEditor($notice->getEditeur())
->setAnnee($notice->getDate())
->setIdOrigine($notice->getIdOai());
$album->save();
$this->_helper->notify($this->view->_('L\'album "%s" a été créé', $album->getTitre()));
......
......@@ -180,7 +180,7 @@ class Admin_OaiControllerImportIsaacAsimovFoundationTest extends Admin_OaiContro
/** @test */
public function newAlbumAuteurShouldBeIsaacAsimov() {
$this->assertEquals('Isaac Asimov', $this->_new_album->getAuteur());
$this->assertEquals('Isaac Asimov', $this->_new_album->getAuthors()[0]->getName());
}
......
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