Unable to read language directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mahara |
Low
|
Aaron Wells | ||
| 1.8 |
Low
|
Aaron Wells |
Bug Description
Running Mahara 1.5 here. No relation to system or PHP version I guess.
On page:
admin/
I get this error:
Unable to read language directory lang [full log appended but not necessary]
which is because in lib/mahara.php on line 596 (+/- 5 lines)
$datarootpaths = (array)
assign array(0 => false) to $datarootpaths
My 3 line patch goes directly below that line and looks like this:
foreach(
if(
unset(
*** full error log ***
Call stack (most recent first):
log_message("Unable to read language directory lang/", 8, true, true) at /srv/http/
log_warn("Unable to read language directory lang/") at /srv/http/
get_languages() at /srv/http/
language_
smarty(array(size 0), array(size 0), array(size 0), array(size 2)) at /srv/http/
auth_draw_
auth_setup() at /srv/http/
require(
Hugh Davenport (hugh-davenport) wrote : | #1 |
Changed in mahara: | |
status: | New → Triaged |
importance: | Undecided → Low |
milestone: | none → 1.7.0 |
Jan Korous (koja) wrote : | #2 |
My solution is just a hotfix which saves the day but doesn't take care of the primary reason for this issue.
Please let someone check it.
Changed in mahara: | |
milestone: | 1.7.0 → 1.8.0 |
Changed in mahara: | |
milestone: | 1.8rc1 → 1.8.0 |
Aaron Wells (u-aaronw) wrote : | #3 |
I was unable to replicate the error in 1.5_STABLE. From looking at the glob() documentation ( http://
There's also this: "Note: On some systems it is impossible to distinguish between empty match and an error. "
It's unclear whether that means that an empty match returns false, or whether it means that an error returns an empty array. But the return value that Jan noted (nearly 1 year ago today) is what you get when you cast boolean false as an array:
var_dump((array) false);
array(1) {
[0]=>
bool(false)
}
Changed in mahara: | |
status: | Triaged → Incomplete |
status: | Incomplete → Triaged |
milestone: | 1.8.0 → 1.8.1 |
Aaron Wells (u-aaronw) wrote : | #4 |
Okay, here's a patch that will provide a warning message that makes more sense. We should still probably be printing a warning message, because if glob() returns false, that indicates an error condition.
Changed in mahara: | |
milestone: | 1.8.1 → 1.8.2 |
Patch for "1.8_STABLE" branch: https:/
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 661a79dc06def9a
Author: Aaron Wells <email address hidden>
Date: Mon Dec 16 15:06:20 2013 +1300
More robust handling of lang directory search problems
Change-Id: Ie3f6b1136307e4
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara/1.9 |
Hi Jan,
If you would like, you can submit this patch to our review system. See https:/ /wiki.mahara. org/index. php/Developer_ Area/Contributi ng_Code# Submitting_ commits_ for_review
Or, if you prefer, one of our developers can do it on your behalf.
Cheers,
Hugh