Skip to content
Snippets Groups Projects
Commit 4556b65a authored by Laurent's avatar Laurent
Browse files

Fix Cosmogramme integration with missing field end separator

parent a4f4d064
Branches
Tags
3 merge requests!366Master,!364Master,!343Dev#14279 integrations exemplaires
......@@ -133,8 +133,9 @@ class parseur {
$fin_enreg = chr(30) . chr(29);
$data = $this->buffer;
$fileSystem = $this->getFileSystem();
while(true) {
$pos = strScan($data,$fin_enreg,0);
$pos = strpos($data, $fin_enreg);
if($pos > 0) {
$this->buffer = substr($data, ($pos+2));
$data = substr($data, 0, ($pos+2));
......
......@@ -1135,6 +1135,28 @@ class NoticeIntegrationItemsIn852Test extends NoticeIntegrationTestCase {
class NoticeIntegrationKohaBadUnimarcTest extends NoticeIntegrationTestCase {
public function getProfilDonnees() {
return Class_IntProfilDonnees::forKoha()->getRawAttributes();
}
public function setUp() {
parent::setUp();
$this->loadNotice('unimarc_bad_pagaille');
}
/** @test */
public function titleShouldBePagaille() {
$this->assertEquals('La Pagaille', $this->notice_data['titres'][0]);
}
}
class NoticeIntegrationKohaPeriodiqueNotIdentifiedTest extends NoticeIntegrationTestCase {
protected $_profil_donnees = [
'id_profil' => 113,
......
03400 2200229 45000010006000000100014000060710037000200730018000570900009000750910019000840990016001031000041001191010008001602000148001682100038003162150026003543000066003803300492004466100013009387000029009519702190009801258 d34.07 Eur bL.c.j. Editions Productionsa820 a3550460034185 a1258 a2b20140822c0 eVERLAYtDVD a20120910 frey50  afre aLa Pagaille fPascal Thomas, réal. et scén.gAgenore Incrocci, scén.gFrançois Périer, Patrick Chesnais, Remy Girard, Coralie Seyrig, act. cL.c.j. Editions Productionsd1991 a1 DVD (100 mn)ccoul. aPrêt + Consultation sur place coll. et Projection collective aMartin, séparé de sa femme Brigitte depuis 7 ans, vit avec Clément et Emilie ses deux enfants d'une vingtaine d'années, et Gabriel son beau père. Il a une relation régulière avec une jeune femme Patricia. Martin retrouve par hasard Brigitte et ils revivent un second grand amour, au grand dam de leurs proches, qui étaient tout à fait satisfaits de ce mode de vie "moderne". Pour échapper à ceux qui veulent les séparer, les époux préfèrent quitter le domicile familial... aComédie aThomasbPascal43704690 3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m3http://catalogue.bnf.fr/ark:/12148/cb16745882m9746643http://catalogue.bnf.fr/ark:/12148/cb16745882maIncroccibAgenoref1919-20054690 13146571743http://ca 13139308153http://catalogue.bnf.f 1aPérier bFrançois4005 0aFRbCVSc20120822 fSTJ006212i34.07w2014-03-05300094077cMTRSTJ20kCo THO52012-12-07o0ecinema adultesddcrDVDm2014-02
......@@ -78,13 +78,17 @@ class Class_NoticeUnimarc_Writer extends Class_NoticeUnimarc {
// récupération du répertoire
$m = 3 + $this->inner_guide['dm1'] + $this->inner_guide['dm2'];
$this->directory = substr($this->full_record, self::LABEL_LENGTH, $this->inner_guide['ba'] - 25);
$unimarc_without_label_and_dir = substr($this->full_record, self::LABEL_LENGTH + strlen($this->directory));
$tmp_dir = array_filter(explode('|', chunk_split($this->directory, $m, '|')));
$dm1 = $this->inner_guide['dm1'];
$dm2 = $this->inner_guide['dm2'];
$adress_length = 3 + $dm1;
$record = explode("\x1e", $this->full_record);
$label_and_dir = array_shift($record);
$record = explode("\x1e", $unimarc_without_label_and_dir);
// in order to remove errors on missing delimiters on start
while(isset($record[0]) && !trim($record[0]))
array_shift($record);
if (count($record)) {
foreach ($tmp_dir as $i => $dir) {
......
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