Commit 58149efe authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon

"Tagged journal entries" block shouldn't grant access to whole journal

Bug 1521818. Making the "Tagged journal entries" block act more like
a collection of "Journal entry" blocks. So, it doesn't add the parent
blog to view_artefacts, only the specific blog entries that are
displayed in the block.

Also removing the title of the parent blog (and the link to it) from
the list of blog entries, like the "Journal entry" block, which
doesn't display the title of the containing journal.

Note the viewer may still have access to the whole blog, if the blog
is also shared on the same page via a "blog" or "recent journal entries"
block.

Change-Id: I33fc7e58b964c03bc8003f1de81a4bf58b6079b7
(cherry picked from commit ada12dba)
parent bad81b1f
......@@ -475,7 +475,6 @@ EOF;
$blogposts = self::get_blog_posts_in_block($instance);
foreach ($blogposts as $blogpost) {
$artefacts[] = $blogpost->id;
$artefacts[] = $blogpost->parent;
$blogpostobj = $instance->get_artefact_instance($blogpost->id);
$artefacts = array_merge($artefacts, $blogpostobj->get_referenced_artefacts_from_postbody());
......
......@@ -118,12 +118,6 @@
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&amp;view={$view}">
{$post->title}
</a>
{str tag='postedin' section='blocktype.blog/taggedposts'}
{if $viewowner}
{$post->parenttitle}
{else}
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->parent}&amp;view={$view}">{$post->parenttitle}</a>
{/if}
<span class="metadata">
{str tag='postedon' section='blocktype.blog/taggedposts'}
{$post->displaydate}
......
@javascript @core @core_content
Feature: Creating a journal
Feature: Creating a journal and testing out tags
In order write in my journal
As an admin
I need to have a journal
Scenario: Creating a Journal and publishing a draft
Given I log in as "admin" with password "Kupuhipa1"
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Kupuhipa1 | test01@example.com | Andrea | Andrews | mahara | internal | member |
| userB | Kupuhipa1 | test02@example.com | Britta | Briggs | mahara | internal | member |
And the following "pages" exist:
| title | description| ownertype | ownername |
| Journal page | Page to contain the tagged journal block | user | userA |
Scenario: Creating a Journal, publishing a draft, using tagged entry block
Given I log in as "userA" with password "Kupuhipa1"
When I choose "Journals" in "Content"
And I follow "New entry"
And I follow "New entry"
And I set the following fields to these values:
| Title *| my diary |
| Entry | I love my mum |
| Title * | My diary entry one |
| Entry | I love my mum |
| Tags | mildred |
| Draft | 1 |
| Allow comments | 0 |
And I press "Save entry"
Then I should see "Journal entry saved"
And I should see "Draft"
# Make entry public
Given I press "Publish"
Then I should see "Published"
And I follow "New entry"
And I set the following fields to these values:
| Title * | My diary entry two |
| Entry | I love my dad |
| Tags | george |
| Draft | 1 |
| Draft | 0 |
| Allow comments | 0 |
And I press "Save entry"
Then I should see "Journal entry saved"
And I press "Publish"
When I follow "Portfolio"
And I follow "Edit \"Journal page\""
And I expand "Journals" node in the "div#content-editor-foldable" "css_element"
And I wait "1" seconds
And I follow "Tagged journal entries" in the "div#blog" "css_element"
And I press "Add"
And I fill in select2 input "instconf_tagselect" with "george" and select "george"
And I press "Save"
Then I should see "My diary entry two"
And I go to portfolio page "Journal page"
And I follow "Edit this page"
And I follow "Share page"
And I select "Public" from "accesslist[0][searchtype]"
And I press "Save"
And I follow "Logout"
And I log in as "userB" with password "Kupuhipa1"
And I go to portfolio page "Journal page"
Then I should see "My diary entry two"
And I should not see "My diary entry one"
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