Skip to content

Commit 6646035

Browse files
committed
Get the list of deprecated macros from the macrosList.
1 parent 8a3ca1c commit 6646035

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/WeBWorK/Utils/Rendering.pm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,18 @@ sub renderPG ($c, $effectiveUser, $set, $problem, $psvn, $formFields, $translati
253253
flags => $pg->{flags},
254254
};
255255

256+
# get a list of the deprecated macros
257+
my @deprecated_macros;
258+
for (keys %{ $pg->{pgcore}{PG_loadMacros}{macroFileList} }) {
259+
my @dirs = split('/', $_);
260+
push(@deprecated_macros, $dirs[$#dirs]) if $dirs[ $#dirs - 1 ] eq 'deprecated';
261+
}
262+
256263
if (ref($pg->{pgcore}) eq 'PGcore') {
257264
$ret->{internal_debug_messages} = $pg->{pgcore}->get_internal_debug_messages;
258265
$ret->{warning_messages} = $pg->{pgcore}->get_warning_messages();
259266
$ret->{debug_messages} = $pg->{pgcore}->get_debug_messages();
260-
$ret->{deprecated_macros} = $pg->{pgcore}{PG_loadMacros}{deprecated_macros};
267+
$ret->{deprecated_macros} = \@deprecated_macros;
261268
$ret->{PG_ANSWERS_HASH} = {
262269
map {
263270
$_ => {

0 commit comments

Comments
 (0)