gjbarnard / moodle-theme_foundation

Foundation theme for Moodle.
GNU General Public License v3.0
8 stars 0 forks source link

Quick search in the forum brings an error #12

Closed miotto closed 2 years ago

miotto commented 2 years ago

Tested with Moodle version 3.11.2+.

forum_quick_search

The quick search in the forum does not work, an error 'Parameter missing' occurs.

forum_quick_search_error

Something was changed in the Moodle core code to the quick search in the forum. 4c71e1d0d0b4e687f781562f97cbac32e975cb84

My solution is to remove the file foundation/templates/mod_forum/quick_search_form.mustache

gjb2048 commented 2 years ago

Needs investigating as to why, but 'just removing the code' is not a solution until the problem is fully understood.

miotto commented 2 years ago

The variable names in the Moodle file moodle/mod/forum/classes/output/quick_search_form.php have changed in commit 4c71e1d, so it is no longer working.

If I change the Theme file foundation/templates/mod_forum/quick_search_form.mustache as follows, then it works again. The following is the diff file.

31,32c31,34
<     <form action="{{actionurl}}" class="form-inline">
<         <input type="hidden" name="id" value="{{courseid}}">
---
>     <form action="{{action}}" class="form-inline">
>         {{#hiddenfields}}
>             <input type="hidden" name="{{ name }}" value="{{ value }}">
>         {{/hiddenfields}}

If it should be a solution, then the description with the example would still have to be adapted.

gjb2048 commented 2 years ago

Affects M3.10 and M3.11.

gjb2048 commented 2 years ago

Humm, can no longer remember why this https://github.com/gjb2048/moodle-theme_foundation/commit/30b7a0a5e14254267a8c38cd6246906a9fadeaf2#diff-2756b8b830ab5e30d7d69ef39c07b9a14e5182b2120e9c1cba9b1870be9b3d38 is the case as there is nothing special about Foundation's changed versions.

gjb2048 commented 2 years ago

Might as well backport to M3.9.

c1nnhector commented 4 months ago

The variable names in the Moodle file moodle/mod/forum/classes/output/quick_search_form.php have changed in commit 4c71e1d, so it is no longer working.

If I change the Theme file foundation/templates/mod_forum/quick_search_form.mustache as follows, then it works again. The following is the diff file.

31,32c31,34
<     <form action="{{actionurl}}" class="form-inline">
<         <input type="hidden" name="id" value="{{courseid}}">
---
>     <form action="{{action}}" class="form-inline">
>         {{#hiddenfields}}
>             <input type="hidden" name="{{ name }}" value="{{ value }}">
>         {{/hiddenfields}}

If it should be a solution, then the description with the example would still have to be adapted.

Thank You miotto, your FIX also works with the same problem in another theme (Edumy)