Issue not found when opening issue from frontend

9 years 8 months ago #1 by atessadri
I have applied the patch as suggested below to solve the SQL error 1054 Unknown column "identified_by"

Can you change line 188 in the file site/components/com_issuetracker/models/itissues.php to be:

$where .= " AND t1.identified_by_person_id = ".$user->id." ";

Anyway now I always get a message "Issue not found".

Here are queries involving it_issues table an the clause identified_by_person_it:

SELECT t1.*,t2.title AS project_name, t2.id AS project_id, t2.access AS project_access ,t3.person_name AS assigned_person_name,t4.person_name AS identified_person_name,t5.status_name AS status_name,t6.priority_name AS priority_name,t7.type_name AS type_name

FROM e0ezj_it_issues AS t1

LEFT JOIN e0ezj_it_projects AS t2
ON t2.id = t1.related_project_id

LEFT JOIN e0ezj_it_people AS t3
ON t3.user_id = t1.assigned_to_person_id

LEFT JOIN e0ezj_it_people AS t4
ON t4.id = t1.identified_by_person_id

LEFT JOIN e0ezj_it_status AS t5
ON t5.id = t1.status

LEFT JOIN e0ezj_it_priority AS t6
ON t6.id = t1.priority

LEFT JOIN e0ezj_it_types AS t7
ON t7.id = t1.issue_type
WHERE ( t1.`state`=1)
AND ( t1.`public` = 1 )
AND t1.`state` >= 0
AND t1.access IN (1,1,2,3)
AND t2.access IN (1,1,2,3)
ORDER BY t1.`ordering` DESC
LIMIT 0, 20

SELECT DISTINCT `identified_by_person_id` AS value, `person_name` AS text
FROM `e0ezj_it_issues` AS t1
LEFT JOIN `e0ezj_it_people` AS t2
on t2.id = t1.identified_by_person_id
WHERE identified_by_person_id IS NOT NULL
ORDER BY person_name

Please Log in or Create an account to join the conversation.

9 years 8 months ago #2 by geoffc
This may be a long answer so bear with me.

An issue is shown in the front end dependant upon a number of conditions.

Issue admin and staff can usually see all issues in the front end. Guest users can only see 'public' issues that are marked as published.Registered (logged in) users can see thier own raised issues plus the same issues that a guest user can see. Also there is another situation where a user raising their issue can immediately see the issue just raised upon saving, but not necessarily at a subsequent visit. To add complexity it also obeys user access groups as well.

So the situation where the issue can not be seen is very dependant upon who is doing the viewing, and if accessed from a menu list view issue list, the options specified upon the menu item.

Looking at the queries you supplied it looks like the issue has to be marked as 'public' (i.e. not a private issue) and published and being views by a guest user. My suspicion is that the issue is not published and hence not visible to the guest user trying to see the issue.

Regards
Geoff

Please Log in or Create an account to join the conversation.

9 years 8 months ago #3 by secloo
geoffc,

I have a issue here.. my registered user cant view the detail of the issue when click the link at the latest Issue List Module.

The strange thing is if I am not login I can click and view the List of Issue.

What could be the problem?
The issue is marked as published, and the access is public.

Please Log in or Create an account to join the conversation.

9 years 8 months ago #4 by chrisc
Can you confirm that the 'identifier' of the issue is the registered user who is trying to view the issue?

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

9 years 8 months ago - 9 years 8 months ago #5 by chrisc
I think I may have found the cause of the problem.

We need to edit the file site/components/com_issuetracker/models/itissues.php so that the old lines 184 -> 189 inclusive become:
if ( $user->guest) {
         // If guest and chk_new set do not check published state.
         if ( $chk_new == 0 )
            $where .= " AND public = 1 ";
      } else  {
         // If Registered user we can see public or their own private issues.
         if ( ! (($isadmin || $isstaff) || $chk_new == 1) ) {
            // Refined to check the it_person id not the user_id.
            $person_id = IssueTrackerHelper::get_itpeople_id($user->id);
 //           $where .= " AND t1.identified_by_person_id = ".$person_id." ";
            $where .= " AND (public = 1 OR ( public = 0 AND t1.identified_by_person_id = ".$person_id.")) ";
         }
      }

Please let me know if it resolves your problem.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

9 years 8 months ago #6 by secloo
Dear Chrisc,

Its a registered user. Ok, I will test it on Monday and revert back. Thank you very on the help.

Please Log in or Create an account to join the conversation.

Time to create page: 0.161 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries