aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/BiblioIsisDb.php13
-rw-r--r--index.php2
-rw-r--r--schemas/fbe.yaml2
3 files changed, 13 insertions, 4 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;
}
diff --git a/index.php b/index.php
index b045be7..4e74b25 100644
--- a/index.php
+++ b/index.php
@@ -14,7 +14,7 @@ require_once 'interface.php';
// Autoloader.
function cinisis_autoload($class) {
- require_once 'classes/' .$class. '.php';
+ require_once 'classes/'. $class .'.php';
}
// Register autoloader.
diff --git a/schemas/fbe.yaml b/schemas/fbe.yaml
index 67082de..6ea95d5 100644
--- a/schemas/fbe.yaml
+++ b/schemas/fbe.yaml
@@ -5,7 +5,7 @@ db:
fields:
1:
name: Código do filme
- repeat: Yes
+ repeat: No
20:
name: Título
repeat: Yes