Commit f051d53b authored by Dianne Tennent's avatar Dianne Tennent
Browse files

Bug 1959613: Problem with viewing annotation feedback

Ensure artefact types match when trying to view feedback
on annotations that has been requested to be made public.

Change-Id: Ica3183d96c18c7ec84d85d4658de45efedde867a
parent 7587ae55
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@ class ArtefactTypeAnnotation extends ArtefactType {
    protected $artefact;          // artefactid of the artefact this annotation is linked to.
    protected $view;              // viewid of the view this annotation is linked to.
    protected $lastcontentupdate; // last updated as a datetime.
    protected $onartefact;        // the annotation is on an artefect

    public function __construct($id = 0, $data = null) {
        parent::__construct($id, $data);
+1 −1
Original line number Diff line number Diff line
@@ -3104,7 +3104,7 @@ function pieform_template_dir($file, $pluginlocation='') {

/**
 * Given a view id, and a user id (defaults to currently logged in user if not
 * specified) will return wether this user is allowed to look at this view.
 * specified) will return whether this user is allowed to look at this view.
 *
 * @param mixed $view           viewid or View to check
 * @param integer $user_id      User trying to look at the view (defaults to
+3 −1
Original line number Diff line number Diff line
@@ -560,7 +560,9 @@ $smarty = smarty(
$commentonartefact = param_integer('artefact', null);
// doublecheck it's a comment on  artefact in case is old email
if ($showcomment) {
    $tmpcomment = new ArtefactTypeComment($showcomment);
    $artefacttype = get_field('artefact', 'artefacttype', 'id', $showcomment);
    $classname = generate_artefact_class_name($artefacttype);
    $tmpcomment = new $classname($showcomment);
    if ($tmpcomment->get('onartefact') && !$commentonartefact) {
        redirect(get_config('wwwroot') . 'view/view.php?id=' . $viewid . '&showcomment=' . $showcomment . '&modal=1&artefact=' . $tmpcomment->get('onartefact'));
    }