kunzite: (Default)
Minnie A. Trethewey ([personal profile] kunzite) wrote in [site community profile] dw_styles2012-08-21 09:47 pm

get_url()

s2
function builtin get_url(string user, string view) : string
"Returns a URL to the specified view for the specified user. Views use the same names as elsewhere. (recent, friends, archive, month, userinfo)";

function builtin get_url(UserLite user, string view) : string
"Returns a URL to the specified view for the specified user. Views use the same names as elsewhere. (recent, friends, archive, month, userinfo)";
Perl
sub get_url
{
    my ($ctx, $obj, $view) = @_;
    my $user;
[...]
    my $u = LJ::load_user($user);
[...]
    my $base = $u->journal_base;
    return "$base/$view";
}
views are in fact not using the all of the same names as LiveJournal. so, it blindly returns whatever string is given. layouts originating on LJ and being ported over to DW can potentially have old code like get_url($e.journal, "friends") and still get http://kunzite.dreamwidth.org/friends which results in a 404 here.

so, the question is, should people know better and update their code or should get_url() have a clause that $view = "read" if $view eq "friends";?