-
-
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
[5.2] ModalSelect: selecting the title for the field value, when possible #43746
Conversation
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. |
1 similar comment
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. |
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. In the normal form we probably could just remove 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. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43746. |
Thanks @Fedik ! |
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 storedsql_title_column
The column name in that tablesql_title_key
The column name that represent the field value, for the "where" query.Testing Instructions
Add
ModalSelect
field in to Custom HTML module: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: