Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Query fails when trying to modify an existing event (ShowAllTalks is empty) #115

Open
pms967 opened this issue Aug 19, 2023 · 0 comments

Comments

@pms967
Copy link

pms967 commented Aug 19, 2023

When trying to modify an existing event, query fails with the following errors:

AH01215: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'ShowAllTalks' at row 1 at MeetingSQL.pm line 558.: MeetingModify

AH01215: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'ShowAllTalks' at row 1 at MeetingSQL.pm line 559.: MeetingModify

It turns out that (in MeetingSQL.pm) $ArgRef->{-showalltalks} is defined, but is an empty string.

I have not fully traced the source of this problem yet (any help or hint would be welcome).

I noticed the problem when trying to modify the short description of an externally managed event. I don't know whether this is a general problem which happens with any kind of events, or only on externally managed ones. I also ignore whether it affects only newer systems (such as AL9 or Ubuntu 22.04, which is what I use) or it happens also on the old CentOS ones.

Nevertheless, as a quick & dirty fix, for the moment I have applied this patch:

--- ../../DocDB-8.8.9/cgi/MeetingSQL.pm	2018-06-26 20:19:08.000000000 +0200
+++ ./MeetingSQL.pm	2023-08-19 18:38:05.265992984 +0200
@@ -536,6 +540,8 @@
   my $AltLocation      = exists $ArgRef->{-altlocation}      ?   $ArgRef->{-altlocation}      : "";
   my $URL              = exists $ArgRef->{-url}              ?   $ArgRef->{-url}              : "";
   my $ShowAllTalks     = exists $ArgRef->{-showalltalks}     ?   $ArgRef->{-showalltalks}     : 0;
+    # print "<p>DEBUG: ShowAllTalks = $ShowAllTalks</p>\n";
+    if ($ShowAllTalks eq '') { $ShowAllTalks = 0 };
   my $Preamble         = exists $ArgRef->{-preamble}         ?   $ArgRef->{-preamble}         : "";
   my $Epilogue         = exists $ArgRef->{-epilogue}         ?   $ArgRef->{-epilogue}         : "";
   my @TopicIDs         = exists $ArgRef->{-topicids}         ? @{$ArgRef->{-topicids}}        : ();

(Among the other things, I will have to check what happen when trying to modify some "ShowAllTalks" in an event managed with DocDB).

BTW: to make it work with current mySQL (8.0), previously I also had to change where there is the "FIXME" for mySQL 3/4...

--- ../../DocDB-8.8.9/cgi/MeetingSQL.pm	2018-06-26 20:19:08.000000000 +0200
+++ ./MeetingSQL.pm	2023-08-19 18:38:05.265992984 +0200
@@ -345,15 +354,10 @@
 
   # FIXME: These next three lines are good for MySQL >= 4, but not MySQL 3
 
-#  my $SessionList   = $dbh -> prepare(
-#    "select SessionID from Session where DATE(StartTime)=?");
-#  $SessionList -> execute($Date);
-
-  # FIXME: These next three lines are good for MySQL 3
-
   my $SessionList   = $dbh -> prepare(
-    "select SessionID from Session where StartTime like ?");
-  $SessionList -> execute($Date."%");
+    "select SessionID from Session where DATE(StartTime)=?");
+  $SessionList -> execute($Date);
+
   $SessionList -> bind_columns(undef, \($SessionID));
   while ($SessionList -> fetch) {
     $SessionID = FetchSessionByID($SessionID);
marcmengel added a commit to marcmengel/DocDB that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant