Go to System - Control Panel.
Click Super User – Edit Account.
Go to any tab, for example User Profile and edit something, then click Save.
Or do not change anything and click Save.
No warnings or errors.
Message displayed: 0 Cannot access offset of type string on string
PHP error log:
[07-Dec-2020 12:10:42 UTC] PHP Warning: Uninitialized string offset 0 in C:\www\joomlatest\administrator\components\com_admin\models\profile.php on line 145
Windows 10, Wampserver 3.2.4
Apache 2.4.43a, MySQL 8.0.20, PHP 8.0.0
@N6REJ The earlier test site had a few extensions, but then I installed J3.9.23 from scratch, set up standard .htaccess and SEF, set error reporting to 'Maximum', went to Super User - Edit Account, clicked Save and got exactly the same PHP warning.
I will now download 3.9.24-dev and see what happens. Should've done that in the first instance...
@N6REJ - ran the update using the 3.9.24-dev patch package and got the same PHP warning in Edit Account - Save. I'll now install 3.9.24-dev from scratch and try again.
@N6REJ - ran the update using the 3.9.24-dev patch package and got the same PHP warning in Edit Account - Save. I'll now install 3.9.24-dev from scratch and try again.
it something with twofactor
joomla-cms/administrator/components/com_admin/models/profile.php
Lines 142 to 150 in 60183c4
I guess you need to have it enabled, or previously used, to get this issue
@Fedik @N6REJ - just confirmed that the issue occurs also in an out-of-the-box 3.9.24-dev, where the only change in the default configuration was the level of error reporting 'Maximum'.
The only Super User was not updated before testing Edit Account. The only enabled authentication plugins are Cookie and Joomla. Therefore it looks like the user data has incorrect default value.
Therefore it looks like the user data has incorrect default value.
yeah, looks like
It seems default should be 'none', but $data['twofactor'] is empty.
I have no idea where it comes from.
the field is hidden
<!-- Used to get the two factor authentication configuration -->
<field
name="twofactor"
type="hidden"
/>
why am I not getting the error.. hmmmm
why am I not getting the error
It can be seen only in PHP logs (if it enabled)
The error happens on "save" action, and following redirect will reload the page, that why.
btw, it not strict for php 8 version, but general mistake somewhere
@Fedik - the warning does not occur in PHP 7.4.13
@zero-24 can you please have a look? it seems was your changes 085f204
I not very know this part, I suspect it need to check
if (!empty($data['twofactor'])
or populate default value when it empty
Well its based on the pre existing code. So when there are new issues with PHP8 it dhould be fixed there too.
@zero-24 - isn't this a new issue with PHP8 or am I missing something? Is it not possible to trace the origin of the incorrect default value and/or fix the code now?
I have not checked the code myself i just wanted to mention that when there is an patch done here the other part should be taken care of too.
When we can find the root cause that would be even better for sure.
@zero-24 Ok, thanks.
Labels |
Added:
?
|
The Save button works all right in 'Edit Account' in J4 Beta6-dev of 8 December in PHP 8.0.0.
Could not duplicate the problem in 3.9.23 and PHP 8.0.0. Error reporting is set to Dev. Changed username and Editor separate times. User saved just fine. No 0 error. Saved without making any change(s). User saved fine. No 0 error.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-10 09:49:32 |
Closed_By | ⇒ | alikon |
I cannot replicate the issue using php8 & staging.

@toivo any extensions installed or settings changed from default?