Skip to content
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

[5.1] Header list field #42736

Merged
merged 6 commits into from Mar 2, 2024
Merged

[5.1] Header list field #42736

merged 6 commits into from Mar 2, 2024

Conversation

Razzo1987
Copy link
Contributor

@Razzo1987 Razzo1987 commented Jan 30, 2024

Improving @brianteeman PR #41122 to extend to field lists.
Thanks to @alikon for the support.

Summary of Changes

Extending the possibility of using the header to list fields as well.
So moving some code from SqlField.php to ListField.php.

Testing Instructions

  1. Create a file of type List

  2. Create a file of type SQL

  3. Create a XML field and add header option

Actual result BEFORE applying this Pull Request

  1. you cannot specify the header, so the first value in the list is always selected when creating an article (even if the field is indicated as not required)
  2. You can specify the header to obviate the problem described in case 1.

Expected result AFTER applying this Pull Request

  1. You may now specify the header

  2. The SQL field still works

  3. now you can add the header from XML too

Link to documentations

Please select:

  • Documentation link for docs.joomla.org: List_form_field_type

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Note:
Eg of SQL query for SQL Field (you need to create some articles for example from sample data):

SELECT #__content.id AS value, #__content.title AS text
FROM #__content

Eg of XML list field:

	<field
		name="test"
		type="list"
		label="test"
		validate="options"
		header="Please select your option"
		>
		<option value="1">JYES</option>
		<option value="0">JNO</option>
	</field>

Razzo1987 and others added 3 commits January 27, 2024 13:52
* add header for listfield

* added  in the parent, so removet from SQL
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.1-dev labels Jan 30, 2024
@Razzo1987 Razzo1987 marked this pull request as ready for review January 30, 2024 21:38
Razzo1987 and others added 2 commits January 31, 2024 19:13
fix spaces

Co-authored-by: Quy <quy@nomonkeybiz.com>
fix spaces pt2

Co-authored-by: Quy <quy@nomonkeybiz.com>
@Razzo1987
Copy link
Contributor Author

Thanks @Quy !

@alikon alikon added the PBF Pizza, Bugs and Fun label Feb 24, 2024
@faustonenci
Copy link

I have tested this item ✅ successfully on 9c12907

good works


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

@walturbo
Copy link

I have tested this item ✅ successfully on 9c12907


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

@joomla-cms-bot joomla-cms-bot removed the PBF Pizza, Bugs and Fun label Feb 24, 2024
@alikon
Copy link
Contributor

alikon commented Feb 24, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 24, 2024
@alikon alikon added the PBF Pizza, Bugs and Fun label Feb 24, 2024
@adj9
Copy link

adj9 commented Feb 24, 2024

I have not tested this item.

its ok


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

@bembelimen
Copy link
Contributor

I see the benefit of this PR, but there should be the following considerations:

  • "Header" is for sure the wrong naming for such a parameter
  • There should be a "show on" function to depend on the "required" field
  • Consider a language string as default?

@bembelimen bembelimen added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Mar 1, 2024
@bembelimen
Copy link
Contributor

Ok, @LadySolveig fought for this PR and convinced me, that we should merge it, so here we go!

@bembelimen bembelimen merged commit 83edfea into joomla:5.1-dev Mar 2, 2024
4 checks passed
@bembelimen
Copy link
Contributor

Thx

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 2, 2024
@bembelimen bembelimen added this to the Joomla! 5.1.0 milestone Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators PBF Pizza, Bugs and Fun PR-5.1-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants