-
Notifications
You must be signed in to change notification settings - Fork 1
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
Issue #66: Add template for search #133
Conversation
I updated the code to try to use a rendered template, if possible. |
Updated instruction with custom field:
|
… issue66-add-template
I merged file search from other PR, as it's for same issue. Testing instruction for file search:
|
classes/search/cmsfield.php
Outdated
|
||
$fileareas = $this->get_search_fileareas(); | ||
// File is in "customfield_file" for component, "value" for filearea, and for customfield data id for itemid. | ||
$contextid = \context_system::instance()->id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it correct context ID for files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For file customfiled, it's using context which is from custom field handler context.
$context = $this->get_field()->get_handler()->get_configuration_context();
https://github.com/andrewhancox/moodle-customfield_file/blob/11a770aa46fa170d498a062a6cf3c75def145bc4/classes/data_controller.php#L76
The get_configuration_context
function in mod_cms is using \context_system::instance();
, so the context for the file should be correct.
return \context_system::instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please create an issue for mod_cms and cross link it to andrewhancox/moodle-customfield_file#10
So we can fix mod_cms search once related customfield_file is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the issue #136
5a504da
to
ae117f1
Compare
Include a template area for searching.
Testing instruction