Skip to content

Commit

Permalink
Show no text_to_html class element in footnote.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Nov 7, 2023
1 parent 4affa26 commit dd72836
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2023-11-04 - Bugfix: Pass footnote content without text_to_html div generation, solves #442.
* 2023-10-09 - Improvement: Add a direct 'view course' icon on the course management pages, solves #129.
* 2023-10-05 - Improvement: Allow the admin to set the background-position of the background and login background images, solves #111.
* 2023-11-03 - Bugfix: Add missing cachedef strings to the language pack, solves #441.
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/footnote.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// Only proceed if text area does not only contains empty tags.
if (!html_is_blank($footnotesetting)) {
// Use format_text function to enable multilanguage filtering.
$footnotesetting = format_text($footnotesetting);
$footnotesetting = format_text($footnotesetting, FORMAT_HTML, ['noclean' => true]);

// Add marker to show the footnote to templatecontext.
$templatecontext['showfootnote'] = true;
Expand Down
21 changes: 16 additions & 5 deletions tests/behat/theme_boost_union_contentsettings_footer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,29 @@ Feature: Configuring the theme_boost_union plugin for the "Footer" tab on the "C

Scenario: Setting: Footnote - Use the footnote setting to show a string in the page footer on the Dashboard, on the course pages and on the login page
Given the following config values are set as admin:
| config | value | plugin |
| footnote | Whatever footnote | theme_boost_union |
| config | value | plugin |
| footnote | <span lang="en" class="multilang">Footnote</span><span lang="de" class="multilang">Fussnote</span> | theme_boost_union |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
When I log in as "admin"
And I follow "Dashboard"
Then "#footnote" "css_element" should exist
And I should see "Whatever footnote" in the "#footnote" "css_element"
And ".text_to_html" "css_element" should not exist in the "#footnote" "css_element"
And I should see "Footnote" in the "#footnote" "css_element"
And I should not see "<span lang=\"en\" class=\"multilang\">Footnote</span>" in the "#footnote" "css_element"
And I should not see "FootnoteFussnote" in the "#footnote" "css_element"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
Then "#footnote" "css_element" should exist
And I should see "Whatever footnote" in the "#footnote" "css_element"
And ".text_to_html" "css_element" should not exist in the "#footnote" "css_element"
And I should see "Footnote" in the "#footnote" "css_element"
And I should not see "<span lang=\"en\" class=\"multilang\">Footnote</span>" in the "#footnote" "css_element"
And I should not see "FootnoteFussnote" in the "#footnote" "css_element"
And I log out
And I follow "Log in"
Then "#footnote" "css_element" should exist
And I should see "Whatever footnote" in the "#footnote" "css_element"
And ".text_to_html" "css_element" should not exist in the "#footnote" "css_element"
And I should see "Footnote" in the "#footnote" "css_element"
And I should not see "<span lang=\"en\" class=\"multilang\">Footnote</span>" in the "#footnote" "css_element"
And I should not see "FootnoteFussnote" in the "#footnote" "css_element"

0 comments on commit dd72836

Please sign in to comment.