Wiki titles not automatically linked

This commit is contained in:
JT Smith 2007-05-02 18:07:57 +00:00
parent 7ebea75e33
commit c1f65c614d
3 changed files with 17 additions and 11 deletions

View file

@ -1,4 +1,5 @@
7.3.16
- fix: Wiki titles not automatically linked
- fix: Calendar Events Disappearing
http://www.plainblack.com/bugs/tracker/calendar-events-disappearing
- fix: Modified SQLForm.pm to handle MySQL null dates. Undefs them. Undef dates default to time(), i.e. today's date

View file

@ -398,16 +398,18 @@ sub getOverrides {
}
$orig->{_propertyDefinitions} = \%properties;
}
$overrides{cacheNotExpired} = 1;
my $sth = $self->session->db->read("select fieldName, newValue from Shortcut_overrides where assetId=? order by fieldName",[$self->getId]);
while (my ($fieldName, $newValue) = $sth->array) {
$overrides{overrides}{$fieldName}{fieldType} = $orig->{_propertyDefinitions}{$fieldName}{fieldType};
$overrides{overrides}{$fieldName}{origValue} = $orig->get($fieldName);
$overrides{overrides}{$fieldName}{newValue} = $newValue;
$overrides{overrides}{$fieldName}{parsedValue} = $newValue;
}
$sth->finish;
} else {
$self->session->errorHandler->warn("Original asset could not be instanciated by shortcut ".$self->getId);
}
$overrides{cacheNotExpired} = 1;
my $sth = $self->session->db->read("select fieldName, newValue from Shortcut_overrides where assetId=".$self->session->db->quote($self->getId)." order by fieldName");
while (my ($fieldName, $newValue) = $sth->array) {
$overrides{overrides}{$fieldName}{fieldType} = $orig->{_propertyDefinitions}{$fieldName}{fieldType};
$overrides{overrides}{$fieldName}{origValue} = $self->getShortcutOriginal->get($fieldName);
$overrides{overrides}{$fieldName}{newValue} = $newValue;
$overrides{overrides}{$fieldName}{parsedValue} = $newValue;
}
$sth->finish;
if ($self->isDashlet) {
my $u = WebGUI::User->new($self->session, $self->discernUserId);
my @userPrefs = $self->getPrefFieldsToImport;

View file

@ -92,10 +92,12 @@ sub autolinkHtml {
my %mapping = $self->session->db->buildHash("SELECT LOWER(d.title), d.url FROM asset AS i INNER JOIN assetData AS d ON i.assetId = d.assetId WHERE i.parentId = ? and className='WebGUI::Asset::WikiPage'", [$self->getId]);
return $html unless %mapping;
foreach my $key (keys %mapping) {
$mapping{$key} = $self->session->url->gateway(WebGUI::HTML::format('/'.$mapping{$key}, 'text'));
$key =~ s{\(}{\\\(}gxms; # escape parens
$key =~ s{\)}{\\\)}gxms; # escape parens
$mapping{$key} = $self->session->url->gateway($mapping{$key});
}
my $matchString = join('|', map{quotemeta} keys %mapping);
my $regexp = qr/\b($matchString)\b/i;
my $regexp = qr/($matchString)/i;
my @acc = ();
my $in_a = 0;
my $p = HTML::Parser->new;
@ -109,6 +111,7 @@ sub autolinkHtml {
$p->handler(text => sub {
my $text = $_[0];
unless ($in_a) {
$text =~ s{\&\#39\;}{\'}xms; # html entities for ' created by rich editor
while ($text =~ s#^(.*?)$regexp##i) {
push @acc, sprintf '%s<a href="%s">%s</a>',
($1, $mapping{lc $2}, $2);