User tests: Successful: Unsuccessful:
Pull Request for Issue # .
JConfig can contain array properties, they are not properly displayed in backend System Information
Add nested array property in configuration.php
:
public $test = [1, 2, 3 => [4, 5]];
Open "System Information > Configuration File" tab
See Warning: Array to string conversion
warnings and no array values are displayed.
See json of arrays
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_admin |
Labels |
Added:
?
|
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.
I have tested this item
I have tested this item
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.
Status | Pending | ⇒ | Ready to Commit |
RTC
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
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.
another question is why should we have array information in the configuration.php?
Status | Ready to Commit | ⇒ | Pending |
Back to pending due to comment #38245 (comment) .
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.
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.
Labels |
Added:
?
|
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.
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.
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.
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.
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.
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?
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.
I would vote this as not a bugfix and thus this would have to go into 4.3.
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 :)
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
|
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.
@Denitz could you give an example to improve your test istructions?