Skip to content

Commit

Permalink
Check $entriesClassTypes variable in teiparser
Browse files Browse the repository at this point in the history
  • Loading branch information
lnprieto committed Nov 30, 2018
1 parent 47c4089 commit f8440b2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lodel/scripts/teiparser.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,17 @@ function($a, $b) use($fieldgroups){
$this->_persontypes[$field->class][$field->type] = $field;
}

$fields = DAO::getDAO('entrytypes')->findMany('status>0 AND class IN ('.join(',', array_map(array($GLOBALS['db'], 'quote'), $entriesClassTypes)).')', 'id', 'id,type,title,style,otx,lang,newbyimportallowed');
if($fields)
{
foreach($fields as $field)
$fields = null;
if (!empty($entriesClassTypes)) {
$fields = DAO::getDAO('entrytypes')->findMany('status>0 AND class IN ('.join(',', array_map(array($GLOBALS['db'], 'quote'), $entriesClassTypes)).')', 'id', 'id,type,title,style,otx,lang,newbyimportallowed');
if($fields)
{
$this->_entrytypes[$field->type] = $field;
$this->_entrytypes[$field->id] = $field;
}
foreach($fields as $field)
{
$this->_entrytypes[$field->type] = $field;
$this->_entrytypes[$field->id] = $field;
}
}
}
}

Expand Down

0 comments on commit f8440b2

Please sign in to comment.