Skip to content
Snippets Groups Projects
Commit fa406b9b authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#78405_minsoc_probleme_d_integration_totale_de_koha_vers_bokeh' into 'hotline'

hotline #78405 fix saving dewey without label

See merge request !2777
parents 9f4ec68c 8c4c8ee6
Branches
Tags
4 merge requests!2806Master,!2789Master,!2785Hotline,!2777hotline #78405 fix saving dewey without label
Pipeline #4774 passed with stage
in 49 minutes and 57 seconds
- ticket #78405 : Intégration cosmogramme : correction du traitement des facettes DEWEY.
\ No newline at end of file
......@@ -171,6 +171,16 @@ class Class_CodifDewey extends Storm_Model_Abstract {
protected $_fixed_id = true;
public function beforeSave() {
parent::beforeSave();
if ($libelle = parent::_get('libelle'))
return $this;
return $this->setLibelle((string) $this->formatIndice($this->getIdDewey()));
}
public function getListeSuggestion($recherche,$mode,$limite_resultat) {
// Lancer la recherche
$new = '';
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class CodifDeweySaveTest extends ModelTestCase {
protected $_storm_default_to_volatile = true;
/** @test */
public function saveWithOutLibelleShouldInsertIndice() {
$this->fixture('Class_CodifDewey',
['id' => 456,
'libelle' => '']);
Class_CodifDewey::clearCache();
$this->assertEquals(['id' => 456,
'id_dewey' => 456,
'libelle' => '456'], Class_CodifDewey::find(456)->getRawAttributes());
}
}
\ No newline at end of file
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