When we deal with modal form submission we can not call optional_param inside the form class because
it does not have information from the AJAX form submission
This is the same situation as was in MDL-56864 but now in 'course', 'autocomplete' and 'select' elements
- if the element allows multiple selection it is impossible to remove the last element
it is quite often when we need to have an autocomplete element that searches courses that
have completion enabled. This commit adds an option for the 'course' form element, and also
changes two places where we search for courses with completion. This should fix MDL-58989
In file_get_all_files_in_draftarea function an integer could get
a null value so it is necessary to execute this function only
when is called with a valid integer value.
In cases when filepicker support is enabled, this patch adds a wrapper
div around the url element and includes the filepicker id in its id.
This allows the js callback code to target the specific input field
with which it is associated.
Forms subsystem has no own database table. The only personal data is the
user preference 'filemanager_recentviewmode' that stores the view mode
of the file picker element.
It was discussed whether handling of this preference should be added
here into core_form, or rather into core_repository subsystem. The final
decision was to consider the preference as owned by the core_form
because it is affecting the display of a form element, not the
repository backend (even though the strings describing it had been put
into core_repository strings).
When using the AJAX autocomplete field, it allows JavaScript to add
custom HTML to selected options. For example, the user field from
the assign roles page includes an icon and other information by the
user's name.
Once you submit the form and the page reloads, there was no way to
provide this information back to the autocomplete field. HTML
<option> tag was used for the value names but it may only contain
text, not tags, so including it in the normal value did not work.
This change adds a new option for the autocomplete field that lets
you include HTML to override the default (text-only) value of the
label used to represent each option.