Bug#139749: webgui
>> Vince Mulhollon <vlm@norlight.com> writes:
> There are some perl issues to work out first.
There are?
The only issue I see right now is that WebGUI, besides being a mess of
hardcoded stuff[0], has its own version of HTML::CalendarMonthSimple.
The way I solved that was just moving HTML/CalendarMonthSimple.pm to
WebGUI/HTML/CalendarMonthSimple.pm, adjusting the use lines and that
was it. That probably clashes with other applications running on the
webserver which do want to use HTML::CalendarMonthSimple because I _did
not_ change neither the package name nor the references to it.
The one other thing I have here, related to the fact that I'm using
WebGUI with PostgreSQL, is:
--- webgui-4.6.9.orig/lib/WebGUI/URL.pm
+++ webgui-4.6.9/lib/WebGUI/URL.pm
@@ -63,7 +63,7 @@
sub makeUnique {
my ($url, $test, $pageId);
$url = $_[0];
- $pageId = $_[1] || "new";
+ $pageId = $_[1] || -1;
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$url' and pageId<>'$pageId'")) {
if ($url =~ /(.*)(\d+$)/) {
$url = $1.($2+1);
I also see:
--- webgui-4.6.9.orig/lib/WebGUI/Wobject.pm
+++ webgui-4.6.9/lib/WebGUI/Wobject.pm
@@ -518,7 +518,7 @@
foreach $key (keys %{$_[1]}) {
$_[0]->{_property}{$key} = ${$_[1]}{$key};
if (isIn($key, qw(userDefined1 userDefined2 userDefined3 userDefined4 userDefined5 moderationType groupToModerate groupToPost karmaPerPost editTimeout title displayTitle description processMacros pageId templatePosition startDate endDate sequenceNumber))) {
- $sql .= " ".$key."=".quote(${$_[1]}{$key}).",";
+ $sql .= " ".$key."=".quote(${$_[1]}{$key})."," if defined(${$_[1]}{$key});
}
if (isIn($key, @{$_[2]})) {
$update[$i] .= " ".$key."=".quote($_[1]->{$key});
but I don't remember the reason for that one.
I have a one liner:
--- webgui-4.6.9.orig/sbin/runHourly.pl
+++ webgui-4.6.9/sbin/runHourly.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl
+
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 Plain Black LLC.
#-------------------------------------------------------------------
Then I have, again a PostgreSQL thing, these:
--- webgui-4.6.9.orig/lib/WebGUI/Operation/Page.pm
+++ webgui-4.6.9/lib/WebGUI/Operation/Page.pm
@@ -150,6 +150,7 @@
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage($session{form}{npp})) {
$f = WebGUI::HTMLForm->new;
+ tie %page, "Tie::CPHash";
if ($session{form}{npp} ne "") {
%page = WebGUI::SQL->quickHash("select * from page where pageId=$session{form}{npp}");
$page{templateId} = 1;
--- webgui-4.6.9.orig/lib/WebGUI/Wobject/FAQ.pm
+++ webgui-4.6.9/lib/WebGUI/Wobject/FAQ.pm
@@ -208,7 +208,7 @@
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}");
- @data = WebGUI::SQL->quickArray("select questionId from FAQ_question where wobjectId=".$_[0]->get("wobjectId")." and sequenceNumber=$thisSeq+1 group by wobjectId");
+ @data = WebGUI::SQL->quickArray("select questionId from FAQ_question where wobjectId=".$_[0]->get("wobjectId")." and sequenceNumber=$thisSeq+1");
if ($data[0] ne "") {
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$session{form}{qid}");
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$data[0]");
@@ -224,7 +224,7 @@
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}");
- @data = WebGUI::SQL->quickArray("select questionId from FAQ_question where wobjectId=".$_[0]->get("wobjectId")." and sequenceNumber=$thisSeq-1 group by wobjectId");
+ @data = WebGUI::SQL->quickArray("select questionId from FAQ_question where wobjectId=".$_[0]->get("wobjectId")." and sequenceNumber=$thisSeq-1");
if ($data[0] ne "") {
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$session{form}{qid}");
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$data[0]");
Oops, I have more patches than I thought :-)
Then I have a bunch of patches to correct the irritating HTML in some
places (the sitemap and the faq I remember, there might be others), but
those are mostly non-interesting, I think.
I wish you fun handling the upgrades ;-) It'd be cool if you could
make a package that supported PostgreSQL, but that's Yet More Fun(TM).
Marcelo
[0] There's a whole bunch of $session{config}{root} . "/etc/" . ...
instead of $session{config}{etc} or whatever, but it has never
bothered me enough to prompt me to fix it.
--
Marcelo | Item 43: Use multiple inheritance judiciously
mmagallo@debian.org | -- Scott Meyers, Effective C++
Reply to: