Skip to content

Commit

Permalink
Ensure compatibility with new Concrte/DBAL versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 24, 2021
1 parent 1ecd6d3 commit 877e645
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Parser/DynamicItem/Area.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,22 @@ protected function getClassNameForExtractor()
public function parseManual(\Gettext\Translations $translations, $concrete5version)
{
$db = \Loader::db();
$rs = $db->Execute('select distinct (binary arHandle) as AreaName from Areas order by binary arHandle');
while ($row = $rs->FetchRow()) {
$sql = 'select distinct (binary arHandle) as AreaName from Areas order by binary arHandle';
if (method_exists($db, 'executeQuery')) {
$rs = $db->executeQuery($sql);
} else {
$rs = $db->Execute($sql);
}
if (method_exists($rs, 'fetchAssociative')) {
$fetcher = 'fetchAssociative';
} else {
$fetcher = 'FetchRow';
}
while ($row = $rs->$fetcher()) {
$this->addTranslation($translations, $row['AreaName'], 'AreaName');
}
$rs->Close();
if (method_exists($rs, 'Close')) {
$rs->Close();
}
}
}

0 comments on commit 877e645

Please sign in to comment.