Commit 1e49ae1a authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #11998 - first running implementation.

parent 50c06e12
Pipeline #5047 passed with stages
in 3 minutes and 53 seconds
......@@ -1128,9 +1128,9 @@ class Database {
$column = (is_numeric($uid)) ? 'uid' : 'subheader';
$dbT3 = $this->store->getVar(SYSTEM_DB_NAME_T3, STORE_SYSTEM);
$sql = "SELECT `bodytext` FROM `$dbT3`.`tt_content` WHERE `$column` = ?";
$sql = "SELECT * FROM `$dbT3`.`tt_content` WHERE `$column` = ?";
$arr = $this->sql($sql, ROW_EXPECT_1, [$uid]);
return ($arr['bodytext']);
return ($arr);
}
}
\ No newline at end of file
......@@ -370,8 +370,9 @@ class Download {
* @throws \UserReportException
*/
private function getEvaluatedBodytext($uid, $urlParam) {
$bodytext = $this->db->getBodytext($uid, $urlParam);
$qfq = new QuickFormQuery([T3DATA_BODYTEXT => $bodytext], false, false);
$bodyTextArr = $this->db->getBodytext($uid, $urlParam);
$qfq = new QuickFormQuery($bodyTextArr, false, false);
return $qfq->process();
}
......
......@@ -60,6 +60,11 @@ class Report {
*/
private $store = null;
/**
* @var Evaluate
*/
private $evaluate = null;
/**
* @var string
*/
......@@ -117,19 +122,19 @@ class Report {
* Report constructor.
*
* @param array $t3data
* @param Evaluate $eval
* @param Evaluate $evaluate
* @param bool $phpUnit
* @throws \CodeException
* @throws \DbException
* @throws \UserFormException
* @throws \UserReportException
*/
public function __construct(array $t3data, Evaluate $eval, $phpUnit = false) {
public function __construct(array $t3data, Evaluate $evaluate, $phpUnit = false) {
#TODO: rewrite $phpUnit to: "if (!defined('PHPUNIT_QFQ')) {...}"
$this->phpUnit = $phpUnit;
Support::setIfNotSet($t3data, "uid", 0);
$t3data["uid"] = $t3data["uid"] ?? 0;
$this->sip = new Sip($phpUnit);
if ($phpUnit) {
......@@ -138,6 +143,7 @@ class Report {
$_SERVER['REQUEST_URI'] = 'localhost';
}
$this->evaluate = $evaluate;
$this->store = Store::getInstance();
$this->showDebugInfoFlag = (Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_YES, $this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM)));
......@@ -167,7 +173,7 @@ class Report {
}
$this->db = new Database($this->dbIndexData);
$this->variables = new Variables($eval, $t3data["uid"]);
$this->variables = new Variables($evaluate, $t3data["uid"]);
$this->link = new Link($this->sip, $this->dbIndexData, $phpUnit);
......@@ -447,10 +453,13 @@ class Report {
$this->store->setStore($tmp, STORE_RECORD, true);
// Get tt_content record bodytext
$bodytext = $this->db->getBodyText($rcFunctionName);
$bodytextArr = $this->db->getBodyText($rcFunctionName);
$report = new Report(array(), $this->evaluate, $this->phpUnit);
// Fire bodytext
$output = $this->process($bodytext);
// Fire bodytext. output is purged
$output = $report->process($bodytextArr[T3DATA_BODYTEXT]);
unset($report);
// Restore and fill STORE_RECORD
$tmp = $this->store->getStore(STORE_RECORD);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment