kunzite: (Default)
Mike 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";?

Post a comment in response:

From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org


 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.