fix(utm): заменить публичную chob на banch (#327)
deploy-preland / deploy zoomstage.online (push) Successful in 42s

This commit is contained in:
Panfilov Konstantin committed 2026-10-25 05:09:55 +03:00
1 parent 08febba368
commit 965eb2e6a5
12 files changed
+58 -33

No files matched your search

+7 -5
View File
@@ -62,12 +62,14 @@ try {
$replace=static function(array $node,string $value) use (&$replacements): void {
$replacements[]=['start'=>$node['start'],'end'=>$node['end'],'text'=>json_encode($value,JSON_THROW_ON_ERROR)];
};
foreach (['theme'=>['dark'=>'1','light'=>'2'],'reg'=>['before'=>'1','after'=>'2'],'chob'=>['b'=>'1','a'=>'2'],'focus'=>['face'=>'1','center'=>'2']] as $key=>$map) {
$old=['reg'=>'registration','chob'=>'bchoice'][$key] ?? null;
foreach (['theme'=>['dark'=>'1','light'=>'2'],'reg'=>['before'=>'1','after'=>'2'],'banch'=>['b'=>'1','a'=>'2'],'focus'=>['face'=>'1','center'=>'2']] as $key=>$map) {
$property=utmConfigProperty($utm,$key);
$legacy=$old===null ? null : utmConfigProperty($utm,$old);
if ($property && $legacy) throw new RuntimeException('Конфликт старого и нового UTM: '.$key);
if ($legacy) { $replace($legacy['key'],$key); $property=$legacy; }
$aliases=['reg'=>['registration'],'banch'=>['chob','bchoice']][$key] ?? [];
foreach ($aliases as $old) {
$legacy=utmConfigProperty($utm,$old);
if ($property && $legacy) throw new RuntimeException('Конфликт старого и нового UTM: '.$key);
if ($legacy) { $replace($legacy['key'],$key); $property=$legacy; }
}
if (!$property) continue;
$setting=$property['value'];
$weights=utmConfigProperty($setting,'weights')['value'] ?? null;