The messageformat and tohtml params have been added to the addDiscussionPost
method to send the original format the contents are written and to force
to convert them from "messageformat" to HTML.
While keeping BC as possible (format will be saved as FORMAT_HTML
as default and content not modified), this commit includes these
changes:
- A new parameter 'messageformat', defaults to FORMAT_HTML.
- A new option 'tohtml', enabling the function to convert content
in other formats to FORMAT_HTML before saving them.
Since the night of the times (MDL-16698) we have been performing
that simple empty($post->messageformat) check to decide if the
preferred editor format should be used, instead of any existing format.
Problem is that FORMAT_MOODLE == 0, so the condition evaluates
to to true and then the preferred editor takes the baton when it should
not. Exiting format must win always!
So this just makes the condition a little better, checking if the
attribute is set and that it's numerical (accepting both n and 'n').
That covers the FORMAT_MOODLE case and any other valid format. Only if the
conditions aren't met the preferred editor format takes the baton. Only
then.
The public function get_section_dates($section, $startdate = false) is
only defined in format_weeks, not in format_base.
As other formats can (and format_topcoll has) declare a different
get_section_dates public method, merely checking that it exists is not
sufficient to guarantee that it can be called with just a section object.
Check that the format either is, or is a subclass of format_weeks.
Instead of creating all the self-conversations during the upgrading,
some code has been added to the get_conversations and to the
get_conversation_counts to create it whe it doesn't exist.
In a Single Simple Discussion forum, the first post can only be edited
by a user with the manageactivities capability, but all other posts
behave as normal.
LTI 1.3 requires working openssl functions to generate a private
key used for the JWT. Some installs (e.g. windows) can have the
functions available - but require configuration in php before they
actually do anything.