? ? PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
8 Jul 2022

Pull Request for Issue # .

Summary of Changes

JConfig can contain array properties, they are not properly displayed in backend System Information

Testing Instructions

Add nested array property in configuration.php:

public $test = [1, 2, 3 => [4, 5]];

Open "System Information > Configuration File" tab

Actual result BEFORE applying this Pull Request

See Warning: Array to string conversion warnings and no array values are displayed.

Expected result AFTER applying this Pull Request

See json of arrays

Documentation Changes Required

No.

avatar Denitz Denitz - open - 8 Jul 2022
avatar Denitz Denitz - change - 8 Jul 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jul 2022
Category Administration com_admin
avatar Denitz Denitz - change - 8 Jul 2022
Labels Added: ?
avatar chmst
chmst - comment - 10 Jul 2022

@Denitz could you give an example to improve your test istructions?

avatar Denitz Denitz - change - 11 Jul 2022
The description was changed
avatar Denitz Denitz - edited - 11 Jul 2022
avatar Denitz
Denitz - comment - 11 Jul 2022

Sorry, I was "inspired" by Joomla3.

Joomla4 has <?php echo HTMLHelper::_('configuration.value', $value); ?> and it's enough for usual array, but multidimensional arrays will cause the issue.

avatar ReLater
ReLater - comment - 19 Jul 2022

I have tested this item successfully on aa14dab


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

avatar ReLater ReLater - test_item - 19 Jul 2022 - Tested successfully
avatar viocassel
viocassel - comment - 20 Jul 2022

I have tested this item successfully on aa14dab


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

avatar viocassel viocassel - test_item - 20 Jul 2022 - Tested successfully
avatar richard67
richard67 - comment - 20 Jul 2022

The file still has old, meanwhile wrong code style (tabs used for indentation) at the places which were not changed by this PR, while the changes of this PR use the right PSR-12 style.

I have no idea why the PHPCS check is successful in Drone with these tabs.

@Denitz Would be cool if you could fix the code style at the other, unchanged places of the file. It would not require new human tests after such a change. Otherwise, if you don't want, we can make a PR for that later.

avatar richard67 richard67 - change - 20 Jul 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 20 Jul 2022

RTC


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

avatar richard67 richard67 - alter_testresult - 20 Jul 2022 - ReLater: Tested successfully
avatar richard67 richard67 - alter_testresult - 20 Jul 2022 - viocassel: Tested successfully
avatar brianteeman
brianteeman - comment - 20 Jul 2022

I have no idea why the PHPCS check is successful in Drone with these tabs.

I asked the same question before and @HLeithner said it wasnt currently something being done

avatar HLeithner
HLeithner - comment - 20 Jul 2022

Sorry ?? '' is not the way to go, please make a validation for string and throw a deprecation warning and add a todo that we can throw an exception or better set a type in the function signature.

avatar HLeithner
HLeithner - comment - 20 Jul 2022

another question is why should we have array information in the configuration.php?

avatar richard67 richard67 - change - 20 Jul 2022
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 20 Jul 2022

Back to pending due to comment #38245 (comment) .


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

avatar ReLater
ReLater - comment - 20 Jul 2022

another question is why should we have array information in the configuration.php?

Because one can override configuration.php (other file location). Not too obvious but without forbidden hacks possible.

avatar HLeithner
HLeithner - comment - 22 Jul 2022

tbh this looks more like a band ad then a proper solution. If this is really needed (and I mean there are better solutions out there) then we should look at them. For example everything beside a scalar value and an array is a problem. So this should be intercepted properly.

Anyway for allowing a null value it should not be hidden behind a ?? '' a proper if statement with maybe a NULL string as return value makes more sense.

57cb2fd 23 Jul 2022 avatar Denitz NULL
avatar Denitz Denitz - change - 23 Jul 2022
Labels Added: ?
avatar Denitz
Denitz - comment - 23 Jul 2022

Sorry, which band ad? 3rd-party extensions can keep own data in global config in order to not perform own data loading operations.

Added NULL string.

avatar HLeithner
HLeithner - comment - 23 Jul 2022

Sorry, which band ad? 3rd-party extensions can keep own data in global config in order to not perform own data loading operations.

json_encode is not a nice visualization of a value for example.

avatar laoneo
laoneo - comment - 23 Oct 2022

Sorry, which band ad? 3rd-party extensions can keep own data in global config in order to not perform own data loading operations.

How? I really see no use case where an extension should add it's own data to the configuration.php.

avatar laoneo
laoneo - comment - 23 Oct 2022

Sorry, which band ad? 3rd-party extensions can keep own data in global config in order to not perform own data loading operations.

How? I really see no use case where an extension should add it's own data to the configuration.php.

avatar Denitz
Denitz - comment - 24 Oct 2022

I have a custom plugin which specially adds special fields to global config with multiple values and I do see the use case of having custom app-related properties.

avatar laoneo
laoneo - comment - 24 Oct 2022

Why do you not store the settings in the plugin settings? Can you share a bit more details why you add your own settings to the global Joomla configuration?

avatar laoneo
laoneo - comment - 24 Oct 2022

You can write your own system plugin and then overwrite the service in the registry. Like that you can then visualize your date in the way you want.

avatar Hackwar
Hackwar - comment - 24 Oct 2022

I would vote this as not a bugfix and thus this would have to go into 4.3.

avatar Denitz
Denitz - comment - 24 Oct 2022

Why do you not store the settings in the plugin settings?

I need the settings to be available before the plugins are loaded from the database.

Can you share a bit more details why you add your own settings to the global Joomla configuration?

I have a complex custom integration service, sorry, can't inform more details. The main issue is that I need to execute own code with custom settings before the plugins are actually loaded, hence I can't afford getting settings from the database.

You can write your own system plugin and then overwrite the service in the registry. Like that you can then visualize your date in the way you want.

Yes, I can, but all modern PHP frameworks allow nested data structures in config and are able to dump them without errors.
I want Joomla to be modern with just a couple lines of code :)

avatar laoneo laoneo - change - 24 Oct 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-10-24 11:10:56
Closed_By laoneo
Labels Added: PR-4.3-dev
avatar laoneo
laoneo - comment - 24 Oct 2022

As I already said, when this is something specifically to your use case, then overwrite the HTML service of the sysconfig view in the plugin or when it is only about one site, then make a template override of that view and display your custom data properly. I'm closing this as there will come too many implications when people start adding arrays to the configuration.php.

avatar laoneo laoneo - close - 24 Oct 2022

Add a Comment

Login with GitHub to post a comment