Hi,
we came across an error "Using $this when not in object context" when frontend editor is used to create articles. If an article editor is open for some time and you want to save it, it fails with "Using $this when not in object context". If you save right or shortly after opening (let's say one or two minutes later), then saving works.
I enabled PHP error logging, and I always find those messages at the time of saving:
[02-Jun-2021 10:22:49 Europe/Vienna] PHP Deprecated: Non-static method T4\Document\Edit::loadTypelistData() should not be called statically in ourphysicalpath\plugins\system\t4\src\t4\Document\Template.php on line 352
[02-Jun-2021 10:22:49 Europe/Vienna] PHP Deprecated: Non-static method T4\Document\Template::loadTypelistData() should not be called statically in ourphysicalpath\plugins\system\t4\src\t4\Document\Edit.php on line 11
[02-Jun-2021 10:41:12 Europe/Vienna] PHP Deprecated: Non-static method T4\Document\Edit::loadTypelistData() should not be called statically in ourphysicalpath\plugins\system\t4\src\t4\Document\Template.php on line 352
[02-Jun-2021 10:41:12 Europe/Vienna] PHP Deprecated: Non-static method T4\Document\Template::loadTypelistData() should not be called statically in ourphysicalpath\plugins\system\t4\src\t4\Document\Edit.php on line 11
I see other JoomlArt related entries in php log file as well, but the times do not correspond to the time of saving:
[02-Jun-2021 10:18:45 Europe/Vienna] PHP Warning: Invalid argument supplied for foreach() in ourphysicalpath\plugins\system\t4\src\t4\Helper\ExtraField.php on line 178
[02-Jun-2021 10:19:27 Europe/Vienna] PHP Warning: Use of undefined constant T4PATH_LOCAL - assumed 'T4PATH_LOCAL' (this will throw an Error in a future version of PHP) in ourphysicalpath\plugins\system\t4\themes\base\html\modules.php on line 27
[02-Jun-2021 10:19:27 Europe/Vienna] PHP Warning: Use of undefined constant T4PATH_TPL - assumed 'T4PATH_TPL' (this will throw an Error in a future version of PHP) in ourphysicalpath\plugins\system\t4\themes\base\html\modules.php on line 33
[02-Jun-2021 10:23:14 Europe/Vienna] PHP Notice: Trying to get property 'image_fulltext' of non-object in ourphysicalpath\templates\ja_flix\html\com_content\article\default.php on line 36
We are using PHP 7.4.18 on a Windows Server 2019 machine. T4 Framework is version 1.1.6, but we have been experiencing this since switching from Fubix (T3) to Flix (T4).
Can you please look into this.