No Code Attached Yet
avatar dagroupinc
dagroupinc
17 Jan 2022

Steps to reproduce the issue

Following Joomla 4 Installation, when configuring the following:

Global Configuration/System/System Cache — selecting any ON cache setting, (OR)
Global Configuration/Server/GZip Page Compression — setting to YES (OR)
Global Configuration/Server/Host* — entering localhost (OR)
Global Configuration/Logging/Log Priorities — entering any option (OR)

Expected result

Successfully Saved Settings

Actual result

When saving any of the above settings the setting was not saved and we received the following error message: Invalid field: Log Priorities

System information (as much as possible)

Joomla 4.0.5
PHP 7.4.27

Additional comments

I was able to successfully save the above settings by modifying the configuration.php file — but not in the Joomla Admin interface

avatar dagroupinc dagroupinc - open - 17 Jan 2022
avatar dagroupinc dagroupinc - change - 17 Jan 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Jan 2022
avatar drmenzelit
drmenzelit - comment - 18 Jan 2022

Go to global configuration -> Logging and check that the Log Priorities field is not empty, All is the standard value. Save and then try to change the configuration again. It should work.

avatar dagroupinc
dagroupinc - comment - 18 Jan 2022

That was also one of the issues. When we entered 'Critical' into the Log Priorities field we got the same error {Invalid field: Log Priorities} and Joomla wouldn't save the option. The only way we could save ANY config on this teb was to make the changes directly in the configuration.php file.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36722.

avatar brianteeman
brianteeman - comment - 21 Jan 2022

I had no problem setting the log priorities to critical and saving

image

avatar chmst
chmst - comment - 22 Jan 2022

I had a similiar error some days ago. After moving a 4.05 installation from one server to a new one. In the original application the value was "all". After installation on the new server (akeeba backup), the field was empty and gave the error message mentioned above when I wanted to change the configuration settings.

avatar Scrabble96
Scrabble96 - comment - 13 Feb 2022

Why doesn't Joomla 4 have 'All' be default instead of leaving it empty and then flagging up an error to totally confuse new J4 users?

avatar chmst
chmst - comment - 13 Feb 2022

Default in new installations is "All". Otherwise there were thousands of issues.
The question is - what happens that the params settings for log properties get lost in some cases? I tried to replicate the issue with different installations but without success.

avatar webgras
webgras - comment - 14 Feb 2022

It just got lost in my case. I had a 4.0.6 on php 7.3.31
I created a backup and extracted it locally on php 8.0. If I go to global configuration now, my field log priorities is empty.
I just checked - on the server it is set - but locally it is empty.
I did not save the configuration in between.
grafik

avatar brianteeman
brianteeman - comment - 14 Feb 2022

How did you make the backup?

avatar webgras
webgras - comment - 14 Feb 2022

Akeeba Backup - just checking again with newest versions and reporting there as well.

avatar webgras
webgras - comment - 14 Feb 2022

Ok, I did the backup again with the newest Akeeba Backup Pro 9.1.0, now after extracting the backup the field is set as before. So, it seems it was a backup problem. @chmst maybe that helps to reproduce (or not ;-)).
grafik

avatar brianteeman
brianteeman - comment - 14 Feb 2022

Just to confirm that I have replicated this bug - now trying to find the cause

avatar brianteeman
brianteeman - comment - 14 Feb 2022

Think I found it

avatar brianteeman
brianteeman - comment - 14 Feb 2022

I don't know if the problem is in core or in akeeba backup so I am posting here AND notifying @nikosdion

When you extract the backup the configuration.php is used in the "Akeeba Backup Site Restoration Script v.9.0.11" but it does replaced the file in the backup with its own version of configuration.php - obviously as there are changed values.

It would be expected that other than path and db details the values are identical but they are not.

I strongly suspect that none of the differences matter EXCEPT for the highlighted one below which is causing the reported problem.

image

avatar brianteeman
brianteeman - comment - 14 Feb 2022

So I should have checked more carefully.

The problem is indeed coming from akeeba backup but it has been resolved with Akeeba Backup 9.1.0 as documented in the changelog.

Fixed [MEDIUM] Log Priorities global configuration option got mangled restoring a Joomla 4 site

It doesnt say but I assume that any backup created with a version of akeeba backup with this bug will be impacted.

avatar chmst
chmst - comment - 14 Feb 2022

Thanks for clearing. As I wrote above, I also had an older version of akeeba backup.

avatar nikosdion
nikosdion - comment - 14 Feb 2022

@brianteeman This has already been fixed in 9.1.0. See https://www.akeeba.com/download/akeeba-backup/9-1-0.html and click on Release Notes under Bug Fixes, last item. This only happened with array values of which there's only one, log priorities. I just saw your emails where you told me that you just saw the changelogs but I am leaving this here so people know there's transparency in this kind of bug fixes :)

Now a bit of a technical explanation. Unlike Joomla itself we can't directly include the configuration.php file because we have seen several sites where the file contains executable PHP code, typically with several assumptions about the execution environment being on a specific server.

In the past we used a bit of rather naïve code which looks for var or public in the file, splits the rest on = and assumes the right hand side is a scalar (integer, string, float). This assumption has worked very well because the only non-scalar value in previous versions of Joomla was the memcache configuration which was subsequently removed.

Seeing the problem with Joomla 4 I wrote a bit of specialised code which uses PHP's Tokenizer to parse the right hand side of the assignment, therefore adding support for arrays (both Joomla's legacy array() syntax and PHP 5.4+ short array syntax). If the Tokenizer is not available — typically because your host doesn't really understand security and disables random, useful and secure stuff — we use in-memory patching of the file and include it with a custom file wrapper. If THAT fails we fall back to direct inclusion — but it happens in the background, on a page called via XmlHttpRequest to make sure that a fatal PHP error in case the file has weird stuff in it doesn't break the restoration. Finally, if even that fails we fall back to the stock Joomla 4 configuration.php example as the source of configuration values.

That's just about a tenth of what happens in the first second of the restoration script's execution. Whoever said that restoring backups was a straightforward, almost trivial process?

avatar brianteeman
brianteeman - comment - 14 Feb 2022

Can be closed as a non-core bug

avatar chmst chmst - change - 14 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-14 18:05:53
Closed_By chmst
avatar chmst chmst - close - 14 Feb 2022
avatar chmst
chmst - comment - 14 Feb 2022

Thanks all for co-operation.

Add a Comment

Login with GitHub to post a comment