Project

General

Profile

Bug #7111

Error when anonymous user acces lp_view

Added by Daniel Barreto over 6 years ago. Updated over 6 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Category:
Learning paths / Lecciones
Target version:
Start date:
29/04/2014
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

When an anounymous user access to lp, this try to save pogress but user_id isn't set

Here a example:

https://stable.chamilo.org/main/newscorm/lp_controller.php?cidReq=CURSO2&id_session=0&gidReq=0&origin=&action=view&lp_id=1


Files

error_lp_anonymous.png (75.1 KB) error_lp_anonymous.png Daniel Barreto, 29/04/2014 00:48
Selection_004.png (17.2 KB) Selection_004.png Julio Montoya, 08/05/2014 16:39

Related issues

Related to Chamilo LMS - Feature #6768: When use the course direct link, allow user to login and directly go into courseFeature implemented11/10/2013

Actions

Associated revisions

Revision 40ac0344 (diff)
Added by Julio Montoya over 6 years ago

Fixing anonymous access to courses + hiding "Joe Anonymous" see #7111

Revision 64a3c47b (diff)
Added by Julio Montoya over 6 years ago

Adding $use_anonymous in lp_controller and lp_view see #7111

History

#1

Updated by Yannick Warnier over 6 years ago

  • Target version set to 1.9.8
#2

Updated by Daniel Barreto over 6 years ago

Error occurs when user isn't initialiazed as anonymous user then user info (i.e the user_id needed for the learnpath class to call method save_last())

$use_anonymous is initialiazed in other files: course_home, agenda, announcements, a lot of files in main/newscorm, etc.
Then initialize $use_anonymous = true at the beginning of lp_view.php

Done in PR#219
https://github.com/chamilo/chamilo-lms/pull/291

#3

Updated by Daniel Barreto over 6 years ago

  • % Done changed from 0 to 60

Update:
Fix how to recover LP object from Session.

By now, this bug is fixed but need to refresh after first load of LP, need to improve, but this would be for later.

Done in same PR#291
https://github.com/chamilo/chamilo-lms/pull/291

#4

Updated by Julio Montoya over 6 years ago

  • Status changed from Assigned to Needs more info
#5

Updated by Julio Montoya over 6 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Daniel Barreto to Julio Montoya

Reviewing this task.

#6

Updated by Julio Montoya over 6 years ago

The error was that the anonymous user is not correctly set in local.inc.php here:

https://github.com/chamilo/chamilo-lms/blob/1.9.x/main/inc/local.inc.php#L667

If we comment the !api_is_anonymous() and I added the $use_anonimous = true in lp_controller part,
then the LP will work correctly because we will have the user_id = 2 (anonymous).

But we will be login in the platform as "Joe Anonymous", I think that we used to work that way in an older version of Chamilo?

#7

Updated by Yannick Warnier over 6 years ago

  • Category set to Learning paths / Lecciones
  • Status changed from Needs more info to Assigned
  • Assignee changed from Yannick Warnier to Julio Montoya

Yes, we worked that way. In fact, the only point of having an anonymous user is this: allow anyone to enter a course and get precise tracking for the time of his/her session, until he goes away, under that user ID (of Joe Anonymous, or better said user 2).

So to me it's not an issue to have him logged as "Joe Anonymous", although we don't really need to see the name there (some non-English speakers might believe it is a real human user and that they are connected with his account.
Maybe we could hack a little into the theme to remove the name (and corresponding drop-down menu) from the menu bar if: api_is_anonymous()?

The initial issue here was really that the direct access (through a link saved somewhere - with action=view in it) to a learning path without being connected is giving you a blank page in the "content" frame. Did you try that case?

#8

Updated by Julio Montoya over 6 years ago

Yannick Warnier wrote:

Yes, we worked that way. In fact, the only point of having an anonymous user is this: allow anyone to enter a course and get precise tracking for the time of his/her session, until he goes away, under that user ID (of Joe Anonymous, or better said user 2).

So to me it's not an issue to have him logged as "Joe Anonymous", although we don't really need to see the name there (some non-English speakers might believe it is a real human user and that they are connected with his account.
Maybe we could hack a little into the theme to remove the name (and corresponding drop-down menu) from the menu bar if: api_is_anonymous()?

Ok I will commit that change.

The initial issue here was really that the direct access (through a link saved somewhere - with action=view in it) to a learning path without being connected is giving you a blank page in the "content" frame. Did you try that case?

Blank page? I reproduced the error that is for me the "initial issue" in image "error_lp_anonymous.png" and is fixed when applying my changes in comment 6.

There's another bug (in another task) that all LPs have a blank page in Chrome due some changes in the CSS see #6999

#9

Updated by Julio Montoya over 6 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)

I sent 2 changes and now is working. But if you have the legal terms turned on then when you click to view the LP item, you have to accept the legal terms which I think is fine.

#10

Updated by Yannick Warnier over 6 years ago

  • Status changed from Needs testing to Bug resolved
  • % Done changed from 60 to 100

Agreed.
I'm closing this one, but we'll have to find a solution to the blank page in chrome in #6999

Also available in: Atom PDF