From fb5bbc4bb8c9b420c94ef1df4e94d4724c8d3471 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 11 Jul 2004 15:53:29 +0000 Subject: [PATCH] various bug fixes --- docs/changelog/6.x.x.txt | 6 +++++- lib/WebGUI/Form.pm | 8 ++++---- lib/WebGUI/Page.pm | 11 +++++++---- lib/WebGUI/i18n/English/WebGUI.pm | 6 ++++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 94cdb9a01..d5f11495b 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -73,12 +73,16 @@ - bugfix [ 934410 ] non-compliant HTML (solution). Thanks to Nicklous Roberts. - bugfix [ 963316 ] Field without title in Content Settings + - Fixed a bug that affected Postgres when creating pages. + - RFE [ 978033 ] WebGUI::Form::fieldType - "float" type is missing - Converted the page tree system from the ajacency list model to the nested set model. Thanks to Martin Kamerbeek / Procolix and Dan Collis Puro for providing the DBIx::Tree::NestedSet module. - Dropped page tree caching and stepped onto Navigation caching. This helps scalability a lot. Thanks to Martin Kamerbeek / Procolix - + + + 6.0.3 - Fixed a recursive style change bug. - Bugfix [ 953593 ] perl -MWebGUI -e "" fails diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index c1caf151f..89991dbc1 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -544,10 +544,8 @@ sub fieldType { my (%hash, $output, $type); tie %hash, 'Tie::IxHash'; # NOTE: What you are about to see is bad code. Do not attempt this - # without adult supervision. =) It was done this way because a huge - # if/elsif construct executes much more quickly than a bunch of - # unnecessary database hits. - my @types = qw(dateTime time zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkList); + # without adult supervision. =) + my @types = qw(dateTime time float zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkList); $_[0]->{types} = \@types unless ($_[0]->{types}); foreach $type (@{$_[0]->{types}}) { if ($type eq "text") { @@ -564,6 +562,8 @@ sub fieldType { $hash{url} = WebGUI::International::get(478); } elsif ($type eq "date") { $hash{date} = WebGUI::International::get(479); + } elsif ($type eq "float") { + $hash{float} = WebGUI::International::get("float"); } elsif ($type eq "email") { $hash{email} = WebGUI::International::get(480); } elsif ($type eq "phone") { diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index b8d092cdc..4700d00b2 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -964,10 +964,13 @@ The page id of the page you're creating a URL for. =cut sub makeUnique { - my ($url, $test, $pageId); - $url = $_[0] || "_1"; - $pageId = $_[1] || "new"; - while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$url' and pageId<>'$pageId'")) { + my $url = $_[0] || "_1"; + my $pageId = $_[1] || "new"; + my $where = "where urlizedTitle=".quote($url); + unless ($pageId eq "new") { + $where .= " and pageId<>".$pageId; + } + while (my ($test) = WebGUI::SQL->quickArray("select urlizedTitle from page ".$where)) { if ($url =~ /(.*)(\d+$)/) { $url = $1.($2+1); } elsif ($test ne "") { diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index cdae7c454..29810f94c 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -7134,6 +7134,12 @@ Following a guide like the above will help you get good ranking on search engine message => q|Ends With|, lastUpdated => 1089039511, context => q|A phrase or word ends with this.| + }, + + 'float' => { + message => q|Decimal|, + lastUpdated => 1089039511, + context => q|A label that tells the user that this field uses a floating point number, aka a Decimal number, aka a Real number.| } };