? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
25 Oct 2021

Pull Request for Issue infograf768/j4localise#42 .

Summary of Changes

Adding a check to the form validate code to respect the "translateLabel" attribute of the field.
Currently it always tries to translate the field label. The PR changes this so you can disable the behaviour by setting the attribute "translateLabel" to "false", "off" or "0".
That attribute and the possible values already exist, I just took the same.

Testing Instructions

I'm not sure how this can be tested. Maybe by leaving a required field empty or entering a non-expected value into a field.
That should give an error with the translated field name both with or without the PR.

With com_localise, the existing error (as stated in the issue) could be prevented by setting the Attribute "translateLabel" to "false". I will add that info to the Issue.

Documentation Changes Required

None as it just extends the existing feature also to the validation.

avatar Bakual Bakual - open - 25 Oct 2021
avatar Bakual Bakual - change - 25 Oct 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Oct 2021
Category Libraries
avatar Valc
Valc - comment - 25 Oct 2021

@Bakual
To test, after apply your patch, i have edited the file:

/administrator/components/com_users/forms/user.xml

To:

		<field
			name="name"
			type="text"
			label="COM_USERS_USER_FIELD_NAME_LABEL"
                        translateLabel="false"
			required="true"
			size="30"
		/>

The oputput without issues (also validating as not allowed if the field is empty), and "Save" without issues or log warning:

solved

I have also tested what we basically need to display without trigger log warnings:

		<field
			name="name"
			type="text"
		        label="&lt;strong&gt;REF_KEY_TO_DISPLAY&lt;/strong&gt;&lt;br&gt;Some string to translate."
                        translateLabel="false"
			required="true"
			size="30"
		/>

solved2

To test it under failure now i use: translateLabel="true" with the next string:
Any string with 2 placeholders %1$s %2$s before a grammar comma, for example.

	<fieldset name="user_details" label="COM_USERS_USER_ACCOUNT_DETAILS">
		<field
			name="name"
			type="text"
			label="&lt;strong&gt;REF_KEY_TO_DISPLAY&lt;/strong&gt;&lt;br&gt;Any string with 2 placeholders %1$s %2$s before a grammar comma, for example."
                        translateLabel="true"
			required="true"
			size="30"
		/>

unsolved

avatar richard67
richard67 - comment - 26 Oct 2021

@Valc Do I understand right that your test was successful? If so, please mark your test result in the issue tracker here https://issues.joomla.org/tracker/joomla-cms/35900 , using the “Test this” button, then selecting the appropriate test result and finally submitting. Thanks in advance.

avatar Valc Valc - test_item - 26 Oct 2021 - Tested successfully
avatar Valc
Valc - comment - 26 Oct 2021

I have tested this item successfully on d60a166


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

avatar Bakual Bakual - change - 26 Oct 2021
Labels Added: ?
avatar infograf768
infograf768 - comment - 26 Oct 2021

I have tested this item successfully on 0fad445


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

avatar infograf768 infograf768 - test_item - 26 Oct 2021 - Tested successfully
avatar infograf768 infograf768 - alter_testresult - 26 Oct 2021 - Valc: Tested successfully
avatar infograf768 infograf768 - change - 26 Oct 2021
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 26 Oct 2021

RTC. Thanks!


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

avatar bembelimen bembelimen - change - 29 Oct 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-10-29 10:26:33
Closed_By bembelimen
Labels Added: ?
avatar bembelimen bembelimen - close - 29 Oct 2021
avatar bembelimen bembelimen - merge - 29 Oct 2021
avatar bembelimen
bembelimen - comment - 29 Oct 2021

Thx

Add a Comment

Login with GitHub to post a comment