-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[com_fields] Fix text-value being reverse for fields: list, radio, checkbox. Fix fields: radio, checkboxes not showing #12739
Conversation
So the code is there to show the proper text based on value and even translate it. Nothing more is needed.
Keep in mind custom fields areen't meant to change behavior. Like change how the layout appears or what it is supposed to do. The fields are meant to add custom data. Like if you have a group of articles about historic events, you could add a date of the event using a custom calendar field. That date is just going to be shown in frontend. |
|
Because i added it in a today's commit, see the commit here: 141309f I added it, after last comments from @infograf768, and after my comment, that the FORM HTML of the fields: radio / checkboxes / list, already assume that "Option Text" need to be JTexted and do it already, so JText for "Option Texts" should be in the view layout too, without a parameter This PR makes multiple but small changes, for the JFormAbstractlist fields: radio, checkboxes, list
|
Oh, I thought that one worked before as well, looks I was wrong. |
we still need to Jtext the label |
right, yes, But JText the label must be a different PR right ? because it is something that effects all fields Like the "0" character as value, is not showing (single value selected), should be a different PR, because it effects all fields too, (i had fix here but it was undone) Otherwise this PR will keep needing retesting, lets keep this PR to effect JFormAbstractlist fields: radio, checkboxes, list |
This PR does already more than what it was supposed to do. Please don't add the label and the 0 issue here or we can never merge it. |
I've tested this with all three types now. They all share an issue in frontend if a 0 value is selected:
I think that was the bug you solved and reverted due to miscommunication between the two of us? The one I referred earlier was when 0 was used as the text not the value. Then the text is ignored and the value is used as text. Like when no text is given. But that is an issue unrelated to com_fields. |
Checkboxes have an additional issue: |
yes exactly
yes
Yes, Because the layout of all files and the helper class need to be to patch: see comment above: #12739 (comment) Let's put it in a different PR together with the label you can do or i will do tomorrow |
… 'name','key' label to be 'text' for these fields
…fields do it already
141309f
to
b121e63
Compare
label PR is here: #12656 |
We need to merge this PR first to solve the other issues properly. From my PoV this is RTC now, but since I'm tester someone else should merge it :) |
…eckbox. Fix fields: radio, checkboxes not showing (joomla#12739) * Fix value-text being reverse for fields list, radio, checkbox, change 'name','key' label to be 'text' for these fields * Fixed calling method from parent class * Added missing layout file for radio field * Fixed character '0' unusuable as field value * Revert fix for zero character as value * Proper variable names for view layouts of options-using fields * They are options not just values * JText the Text of options in the view layouts, since respective form fields do it already
Pull Request for Issue #12725
Summary of Changes
NOTE: zero (single character '0') is not yet usable as field value, do not use it yet (there will be another)
(...) they used name="key" inside their XML file, instead of name="name" that php code expects in:
libraries/joomla/form/abstractlist.php
Testing Instructions
Documentation Changes Required
None