Skip to content

Commit

Permalink
MDL-70705 block_blog_recent: support multilang blog entry titles
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Feb 3, 2021
1 parent fb9419e commit ad04c62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion blocks/blog_recent/block_blog_recent.php
Expand Up @@ -114,7 +114,8 @@ function get_content() {

foreach ($entries as $entryid => $entry) {
$viewblogurl->param('entryid', $entryid);
$entrylink = html_writer::link($viewblogurl, shorten_text($entry->subject));
$entrylink = html_writer::link($viewblogurl, shorten_text(format_string($entry->subject, true,
['context' => $context])));
$entrieslist[] = $entrylink;
}

Expand Down
Expand Up @@ -16,6 +16,8 @@ Feature: Students can use the recent blog entries block to view recent entries o
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
Expand All @@ -27,13 +29,13 @@ Feature: Students can use the recent blog entries block to view recent entries o
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
Then I should see "S1 First Blog ENGLISH"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I should see "S1 First Blog"
And I should see "S1 First Blog ENGLISH"
And I follow "S1 First Blog"
And I should see "This is my awesome blog!"

Expand Down

0 comments on commit ad04c62

Please sign in to comment.