Commit bec503ce authored by Maria Sorica's avatar Maria Sorica Committed by Cecilia Vela Gurovic

Bug 1734182: Add privacy to the site_content_version table

Add the site Privacy Statement to the 'site_content_version' table during installation

behatnotneeded

Change-Id: I50016c5d91df776025aa8ebb54077ae953844603
parent 7466626c
......@@ -756,15 +756,27 @@ function core_install_lastcoredata_defaults() {
$now = db_format_timestamp(time());
foreach ($pages as $name) {
$page = new stdClass();
$page->name = $name;
$page->ctime = $now;
$page->institution = 'mahara';
$page->content = get_string($name . 'defaultcontent', 'install', get_string('staticpageconfigdefault', 'install'));
$page->name = $name;
$page->mtime = $now;
$page->mauthor = $userid;
$page->content = get_string($page->name . 'defaultcontent', 'install', get_string('staticpageconfigdefault', 'install'));
$page->institution = 'mahara';
insert_record('site_content', $page);
}
$versionedpages = site_content_version_pages();
foreach ($versionedpages as $name) {
$page = new stdClass();
$page->ctime = $now;
$page->institution = 'mahara';
$page->content = get_string($name . 'defaultcontent', 'install', get_string('staticpageconfigdefault', 'install'));
$page->type = $name;
$page->author = $userid;
$page->version = '1.0';
insert_record('site_content_version', $page);
}
// install the default layout options
install_view_layout_defaults();
......
......@@ -3188,7 +3188,15 @@ function site_menu() {
* @return array of names
*/
function site_content_pages() {
return array('about', 'home', 'loggedouthome', 'privacy', 'termsandconditions');
return array('about', 'home', 'loggedouthome', 'termsandconditions');
}
/**
* Returns the list of site versioned content pages
* @return array of names
*/
function site_content_version_pages() {
return array('privacy');
}
function get_site_page_content($pagename) {
......
......@@ -19,6 +19,6 @@ Scenario:Injecting sql in groups search field
When I set the following fields to these values:
| search_query | <script>alert(1);</script> |
And I press "search_submit"
And I follow "Privacy statement"
And I should see "Introduction"
And I follow "About"
And I should see "About us"
Then I go to "homepage"
......@@ -26,7 +26,7 @@ Scenario: Creating a page with content in it (Bug 1426983)
And I press "Add"
And I press "Save"
# Adding profile info block
And I expand "Personal info" node
And I expand "Personal info" node in the "blocktype sidebar" property
And I follow "Profile information"
And I press "Add"
And I press "Save"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment