The problem is in lib/MT/Template/Context.pm. Here is why I think MTEntryModifiedDate does not work:
When an MTEntries tag is processed, MT stores the modified_on date within the context of the entry.
(Line 690 in Context.pm)
CODE
for my $e (@entries) {
local $ctx->{__stash}{entry} = $e;
local $ctx->{current_timestamp} = $e->created_on;
local $ctx->{modification_timestamp} = $e->modified_on;
This is the code that specifically handles MTEntryModifiedDate tags (starting at line 782 in Context.pm):
CODE
sub _hdlr_entry_mod_date {
my $args = $_[1];
$args->{ts} = $args->{modification_timestamp};
_hdlr_date($_[0], $args);
}
What this code is supposed to do is read the entry modified date from the entry, store it as a 'ts' (timestamp) argument in the argument list, then pass the entry context and the argument list (including the new 'ts' argument) to the code that handles MT's date tags.
Line 784 fails to correctly read the entry modified date:
CODE
$args->{ts} = $args->{modification_timestamp};
...because it is trying to read the entry modified date from the list of arguments ($args), instead obtaining it from the entry context where it was stored (which can be accessed via $_[0]).
In MT's date handler code (line 1068 in Context.pm):
CODE
sub _hdlr_date {
my $args = $_[1];
my $ts = $args->{ts} || $_[0]->{current_timestamp};
...MT then picks up the created_on date instead (3rd line above), because the MTEntryModifiedDate code failed to properly read the modified_on date (the 'ts' argument here will be empty/undefined). Note that MT picks up the created_on date here from $_[0] (the entry context), not $args (the argument list).
How to fix:Change line 784 in Context.pm:
CODE
$args->{ts} = $args->{modification_timestamp};
...to the following, making it read the modified_on date from the entry context:
CODE
$args->{ts} = $_[0]->{modification_timestamp};
Save the modified Context.pm, upload to the server in ASCII mode, and the MTEntryModifiedDate tag should now function correctly. (You'll need to rebuild your templates to see the new code take effect.)