From d1ebb39b110e09c4ac87a947a82d2e28255611c6 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 23 Apr 2007 21:23:05 +0000 Subject: [PATCH] Make sure Event menuTitles are <= 15 characters --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Event.pm | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b3e515148..e74dde606 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -18,6 +18,8 @@ http://www.plainblack.com/bugs/tracker/webguiimage-new-doesnt-obey-width-and-height-settings - fix: Calendar week view didn't display events correctly if they happened on Sunday or if first day of week was set to Monday. + - fix: Events limit menuTitle to 15 characters yet if not specified, used + Title without limiting its length. 7.3.14 - fix: a typo in DatabaseLink.pm diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index 390c8784c..1603ebaa6 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -165,7 +165,16 @@ sub canEdit { } - +sub update { + my $self = shift; + my $properties = shift; + # Make sure menuTitle has some text, and that it is <= 15 characters. + if (exists $properties->{menuTitle}) { + $properties->{menuTitle} ||= $properties->{title} || $self->getTitle; + $properties->{menuTitle} = substr($properties->{menuTitle}, 0, 15); + } + return $self->SUPER::update($properties); +}