Fix for additional header/footer data

This commit is contained in:
Sven Wappler 2017-12-11 20:12:34 +01:00
parent 818602a1e0
commit c4ff8f2fee

View file

@ -64,16 +64,18 @@ class Helper
if ($pageBPageId) { if ($pageBPageId) {
$pageBPropertiesArray = $pageRepository->getPage($pageBPageId);
$cookieValue = $_COOKIE['abtest2']; $cookieValue = $_COOKIE['abtest2'];
if ($cookieValue === 'b') { if ($cookieValue === 'b') {
$targetPageId = $pageBPageId; $targetPageId = $pageBPageId;
$currentPagePropertiesArray = $pageBPropertiesArray;
} else if ($cookieValue === 'a') { } else if ($cookieValue === 'a') {
} else { } else {
$cookieValue = 'a'; $cookieValue = 'a';
/* select least used page */ /* select least used page */
$pageBPropertiesArray = $pageRepository->getPage($pageBPageId);
if ((int)$currentPagePropertiesArray['tx_abtest2_counter'] > (int)$pageBPropertiesArray['tx_abtest2_counter']) { if ((int)$currentPagePropertiesArray['tx_abtest2_counter'] > (int)$pageBPropertiesArray['tx_abtest2_counter']) {
/* take b */ /* take b */
$targetPageId = $pageBPageId; $targetPageId = $pageBPageId;