Feature RTC PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
6 Jul 2024

Pull Request for Issue # .

Summary of Changes

As for now ModalSelect does not able to display the title for selected value, after saving.
This PR add a posibility to do it.
To make it work, the field XML should have 3 attributes:

  • sql_title_table The table wehre the title is stored
  • sql_title_column The column name in that table
  • sql_title_key The column name that represent the field value, for the "where" query.

Testing Instructions

Add ModalSelect field in to Custom HTML module:

<field
  type="ModalSelect"
  name="article"
  label="Article"

  select="true"
  titleSelect="Selecting the Article"
  urlSelect="index.php?option=com_content&amp;view=articles&amp;layout=modal&amp;tmpl=component"
  clear="true"
  
  sql_title_table="#__content"
  sql_title_column="title"
  sql_title_key="id"
/>

Go to the module editing, and select any article with this field, and save the module.

Actual result BEFORE applying this Pull Request

After saving the field display the article ID

Expected result AFTER applying this Pull Request

After saving the field display the article title

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: TBD
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 6 Jul 2024
avatar Fedik Fedik - change - 6 Jul 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jul 2024
Category Libraries
d2df774 6 Jul 2024 avatar Fedik cs
avatar Fedik Fedik - change - 6 Jul 2024
Labels Added: Feature PR-5.2-dev
be34f77 6 Jul 2024 avatar Fedik cs
avatar Quy Quy - test_item - 9 Jul 2024 - Tested successfully
avatar Quy
Quy - comment - 9 Jul 2024

I have tested this item ✅ successfully on be34f77


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

avatar robbiejackson robbiejackson - test_item - 25 Jul 2024 - Tested successfully
avatar robbiejackson
robbiejackson - comment - 25 Jul 2024

I have tested this item ✅ successfully on be34f77


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

avatar robbiejackson
robbiejackson - comment - 25 Jul 2024

The only issue is that both the id field and the title field are sent in the POST parameters when the form is submitted, which looks rather peculiar, but works I think because the title field is sent first, and it somehow then gets overwritten by the id field (maybe in the processing by the PHP processor).

What about setting the title field as disabled? I believe it won't then get submitted.

Or at least provide an option to disable the title field.

avatar Fedik
Fedik - comment - 26 Jul 2024

@robbiejackson thanks for feedback.
This was made for purpuse. For accessibility. Because the field linked to the label by for attribute.

In the normal form we probably could just remove name attribute from the title field. However in the subform field, this field will lost connection with its label, due to how subform work (it calculate id of the input based on its name, and latter looking for the label for attribute ).

The browser will submit both, but the latter one will overide first one, so here is no problem.

avatar robbiejackson
robbiejackson - comment - 26 Jul 2024

Ah, ok, thanks for the explanation Fedik.

avatar Quy Quy - change - 26 Jul 2024
Status Pending Ready to Commit
avatar Quy
Quy - comment - 26 Jul 2024

RTC


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

avatar Quy Quy - change - 27 Jul 2024
Labels Added: RTC
avatar pe7er pe7er - change - 9 Aug 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-08-09 07:51:51
Closed_By pe7er
avatar pe7er pe7er - close - 9 Aug 2024
avatar pe7er pe7er - merge - 9 Aug 2024
avatar pe7er
pe7er - comment - 9 Aug 2024

Thanks @Fedik !

Add a Comment

Login with GitHub to post a comment