View Issue Details

IDProjectCategoryView StatusLast Update
0006029OXID eShop (all versions)4. ------ eShop Core -------public2017-07-04 10:44
Reportermichael_keiluweit 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version4.9.2 / 5.2.2 
Target VersionFixed in Version6.0.0-rc.2 
Summary0006029: The shop framework tries to set cookies when it is called via CLI
DescriptionWhen calling the shop framework by a cronjob, it is called via CLI. So in this case the shop shouldn't set (or try to set) cookies.
Steps To ReproduceSee "Additional Information". Execute the script by calling it from the console:
$ php cron.php


Be sure that warnings are displayed or at least saved to a log file.
Additional InformationFile: bin/cron.php

<?php
require_once dirname(__FILE__) . '/../bootstrap.php';

// initializes singleton config class
$myConfig = oxRegistry::getConfig();

// executing maintenance tasks..
//oxNew('oxmaintenance')->execute();



$oxidOfAnExampleOrder = 'ef5ddc74afbb8dd549fd5c5fd3bc9828';



echo 'This will cause the Error: "PHP Warning:  Cannot modify header information - headers already sent by"';

$order = oxNew('oxorder');

if ($order->load($oxidOfAnExampleOrder)) {
    $order->oxorder__oxtrackcode = new oxField('foobar');
    $order->save();

    $mail = oxNew('oxemail');
    $mail->sendSendedNowMail($order);
}

// closing page, writing cache and so on..
$myConfig->pageClose();

echo 'Last output.' . PHP_EOL;
TagsCookies, Cron Jobs
ThemeAzure
BrowserAll
PHP VersionNot defined
MySQL VersionNot defined

Activities