#19113Enable USER object to become USER_INT on the fly
Description
Sometimes USER objects need to become USER_INT. The attached patch makes it possible.
USER object now can call a method of tslib_cObj to convert themselves from USER to USER_INT. Any existing output will be discarded and they will be called again as a USER_INT object. Here is code example:
if ($this->cObj->getUserObjType() == tslib_cObj::OT_USER) {
$content = 'I am running as USER object now.';
if (!$this->conf['allowCaching']) {
$this->cObj->convertToUSER_INT();
return '';
}
}
else {
$content .= 'I am running as USER_INT right now';
}
Extension can (and should!) check if it is running as USER or USER_INT. Additionally extensions must have “includeLibs” just like any other USER_INT in their TS setup. But they must be declared as USER.
Patch and test extension are attached.
(issue imported from #M8985)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.