[ww-bugs] Bug 3414: Can't find CAPA macros via Contrib link:

bugzilla-daemon at webwork.maa.org bugzilla-daemon at webwork.maa.org
Sat Sep 5 11:42:57 EDT 2015


http://bugs.webwork.maa.org/show_bug.cgi?id=3414


Mike Gage <gage at math.rochester.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |gage at math.rochester.edu




--- Comment #1 from Mike Gage <gage at math.rochester.edu>  2015-09-05 11:42:56 ---
The problem is that StdMacros is called by PG_CAPAmacros.pl and it doesn't know
where the current tempDirectory is -- it's used to using the full path as
defined in 
localOverrides in the PG special variables.

One solution is this in IO.pm

sub read_whole_file {
    my $filePath = shift;

    die "File path $filePath is unsafe." 
        unless path_is_course_subdir($filePath);
    my $templateDirectory = eval('$main::templateDirectory'); #get current
directory
    local (*INPUT);
    open(INPUT, "<$templateDirectory/$filePath") || die "$0: read_whole_file
subroutine: <BR>Can't read file $templateDirectory/$filePath";
    local($/)=undef;
    my $string = <INPUT>;  # can't append spaces because this causes trouble
with <<'EOF'   \nEOF construction
    close(INPUT);
    \$string;
}

we'll have a permanent solution in 2.11

-- 
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the webwork-bugs mailing list