aboutsummaryrefslogtreecommitdiff
path: root/classes/BiblioIsisDb.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-06-07 17:19:43 -0300
committerSilvio <silvio@devlet.com.br>2010-06-07 17:19:43 -0300
commit7571cef86ee48c928e615bc0822c8ab7e4eb2fd3 (patch)
tree01d2715d6c2fec3773276380921f864427c4c6df /classes/BiblioIsisDb.php
parentbef54fe954aa73325212c3e311b12f863bc9e385 (diff)
downloadcinisis-7571cef86ee48c928e615bc0822c8ab7e4eb2fd3.tar.gz
cinisis-7571cef86ee48c928e615bc0822c8ab7e4eb2fd3.tar.bz2
BiblioIsisDb: changes in the tag scheme to deal with undefined subfields
Diffstat (limited to 'classes/BiblioIsisDb.php')
-rw-r--r--classes/BiblioIsisDb.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php
index e902a93..6ae5827 100644
--- a/classes/BiblioIsisDb.php
+++ b/classes/BiblioIsisDb.php
@@ -155,9 +155,17 @@ class BiblioIsisDb implements IsisDb {
// Subfield handling.
if (isset($this->format['fields'][$key]['subfields']) && is_array($data[$name])) {
foreach ($data[$name] as $subkey => $subvalue) {
- $subname = $this->format['fields'][$key]['subfields'][$subkey];
+ if (isset($this->format['fields'][$key]['subfields'][$subkey])) {
+ $subname = $this->format['fields'][$key]['subfields'][$subkey];
+ } else {
+ $subname = $subkey;
+ }
+
$data[$name][$subname] = $subvalue;
- unset($data[$name][$subkey]);
+
+ if ($subkey != $subname) {
+ unset($data[$name][$subkey]);
+ }
}
}
}
@@ -187,6 +195,7 @@ class BiblioIsisDb implements IsisDb {
$this->format['fields'][$key]['repeat'] == FALSE && is_array($value)) {
return $value[0];
}
+
return $value;
}