Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.8.2
-
Fix Version/s: None
-
Component/s: RSS
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE
Description
Whenever I tried to access an internal Moodle RSS Feed, I got an error. It turns out there is a typo in a block of code in moodle/rss/file.php:
//Check for "security" if the course is hidden or the activity is hidden
if (Unable to render embedded object: File ($isblog and () not found.$course->visible || !$cm->visible) && (!has_capability('moodle/course:viewhiddenactivities', $context))) {
rss_not_found();
}
In the if statement above, the "and" should be a "&&". Because of this typo, the rss_not_found() function is being invoked in situations where it shouldn't.
I believe the corrected code should be:
//Check for "security" if the course is hidden or the activity is hidden
if (Unable to render embedded object: File ($isblog && () not found.$course->visible || !$cm->visible) && (!has_capability('moodle/course:viewhiddenactivities', $context))) { rss_not_found(); } }
I do not think that the "and" affects the result of the if condition.
I think the problems might be in the has_capability() call, because it can not be used without userid when cookies not used.
Assigning to Yu...