Skip to content

Commit edb2f92

Browse files
committed
Fixed #22
1 parent 23731b1 commit edb2f92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Backend/TagUtils.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,14 @@ public function createTag($data)
163163
$data['sh5_pid'] = $data['id'];
164164
$data['sorting'] = $data['sorting'] + 1;
165165
}
166-
166+
167167
$data['tstamp'] = time();
168168
unset($data['id']);
169169

170+
//remove fields which are not present in the db table (See #22)
171+
$tableFields = array_flip(\Database::getInstance()->getFieldNames($this->table));
172+
$data = array_intersect_key($data, $tableFields);
173+
170174
// Insert the tag
171175
$result = \Database::getInstance()
172176
->prepare("INSERT INTO " . $this->table . " %s")

0 commit comments

Comments
 (0)