No Code Attached Yet
avatar brianteeman
brianteeman
25 Jul 2023

JSCHEMAORG_FIELD_COMPONENT_SECTIONS_TEXT="%2$s"

Surely we don't need meaningless strings like this.

avatar brianteeman brianteeman - open - 25 Jul 2023
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jul 2023
avatar richard67
richard67 - comment - 25 Jul 2023

The only place where that string is used is here: https://github.com/joomla/joomla-cms/blob/5.0-dev/libraries/src/Form/Field/SchemaorgComponentSectionsField.php#L52

As one can see, the language string JSCHEMAORG_FIELD_COMPONENT_SECTIONS_TEXT contains only one positional parameter, but the sprintf is called with 2 parameters. This is definitely wrong.

The PHP code mentioned above was obviously copied from here: https://github.com/joomla/joomla-cms/blob/5.0-dev/libraries/src/Form/Field/WorkflowComponentSectionsField.php#L62

The corresponding language string is JWORKFLOW_FIELD_COMPONENT_SECTIONS_TEXT="%1$s: %2$s".

So either we fix the string JSCHEMAORG_FIELD_COMPONENT_SECTIONS_TEXT to be like the one for workflows, or we fix the call to it so it uses only one parameter. But in the latter case it would not need the JSCHEMAORG_FIELD_COMPONENT_SECTIONS_TEXT string at all.

avatar brianteeman
brianteeman - comment - 25 Jul 2023

go for the latter or we swap one useless string for another useless string

avatar brianteeman brianteeman - change - 23 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-23 21:00:28
Closed_By brianteeman
avatar brianteeman brianteeman - close - 23 Feb 2024
avatar brianteeman
brianteeman - comment - 23 Feb 2024

see #42867

Add a Comment

Login with GitHub to post a comment