Passing calling __LINE__ through getlangsidsarr and getlangsid the right way

This commit is contained in:
pezcurrel 2023-01-01 19:26:39 +01:00
parent 87fbbbd2f9
commit fa97078fe4

View file

@ -640,7 +640,7 @@ if ($instanswered && isset($idata['languages']) && is_array($idata['languages'])
eecho(1,'«'.$opts['hostname'].'»: declared languages: '.implode(', ',$idata['languages']).N);
if (!$opts['dryrun']) {
myq($link,'DELETE FROM InstLangs WHERE InstID='.$instid,__LINE__);
$langids=getlangsidsarr($idata['languages'],$link,$opts['hostname'],$opts['dryrun']);
$langids=getlangsidsarr($idata['languages'],$link,$opts['hostname'],$opts['dryrun'],__LINE__);
$pos=0;
foreach ($langids as $langid) {
$pos++;
@ -663,7 +663,7 @@ if ($instanswered && isset($idata['languages']) && is_array($idata['languages'])
}
if (!$opts['dryrun']) {
myq($link,'DELETE FROM InstOurLangs WHERE InstID='.$instid,__LINE__);
$langids=getlangsidsarr($idata['languages'],$link,$opts['hostname'],$opts['dryrun']);
$langids=getlangsidsarr($idata['languages'],$link,$opts['hostname'],$opts['dryrun'],__LINE__);
$pos=0;
foreach ($idata['ourlanguages'] as $lang) {
$pos++;
@ -1245,10 +1245,10 @@ function getlangid(&$link,$lang,$hostname,$dryrun,$line) {
return($langid);
}
function getlangsidsarr(&$langs,&$link,$hostname,$dryrun) {
function getlangsidsarr(&$langs,&$link,$hostname,$dryrun,$line) {
$langids=[];
foreach ($langs as $lang) {
$langid=getlangid($link,$lang,$hostname,$dryrun,__LINE__);
$langid=getlangid($link,$lang,$hostname,$dryrun,$line);
$langids[]=$langid;
}
$langids=array_unique($langids);