User tests: Successful: Unsuccessful:
Pull Request for Issue # .
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 storedsql_title_column The column name in that tablesql_title_key The column name that represent the field value, for the "where" query.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&view=articles&layout=modal&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.
After saving the field display the article ID
After saving the field display the article title
Please select:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
Feature
PR-5.2-dev
|
||
I have tested this item ✅ successfully on be34f77
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.
@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.
Ah, ok, thanks for the explanation Fedik.
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
|
||
| 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 |
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.