Set context setting 'context_type' if parameter was submitted through POST#11
Set context setting 'context_type' if parameter was submitted through POST#11junpataleta wants to merge 1 commit into1EdTech:masterfrom junpataleta:issue-011
Conversation
|
I would probably add the type as a property of Context. But do you think there is a need to store this value in the database so that it can be retrieved with the Context record, or will having it only available when messages are being processed fit your needs? |
|
Thanks. I see, perhaps it makes better sense to set it as a property of Context. I will update the patch. In Moodle though, we basically need to retrieve the context type later (e.g. in enrol_lti when building the memberships URL for the mod_lti membership service which has a URL template of I would also like to confirm something about memberships URL in the library. I noticed that Context::getMembership() only uses the In the meantime though, what we did for LTI 2 is that we are building the memberships URL from the endpoint URL template for the memberships service that we got from the consumer profile. Then we save this built memberships URL as the context's Thanks! Edit: Patch updated. Please have a look. |
* Also, assign context type to the ToolProvider's context instance if a 'context_type' parameter was submitted thru POST
|
Code looks good. 👍 |
The context_type setting doesn't seem to be set in anywhere in the ToolProvider class. So there's no way to fetch the context_type setting when needed.
I have provided a commit that saves this context setting in ToolProvider::authenticate(). Please feel free to pull this if it's correct.
Thanks!