Commit 87fba90e authored by Frank Bergmann's avatar Frank Bergmann

- added a check to avoid SQL error

parent 26c979da
...@@ -188,14 +188,23 @@ where topic_id=:topic_id" ...@@ -188,14 +188,23 @@ where topic_id=:topic_id"
} }
# im_forum_topics_user_map may or may not exist for every user. # im_forum_topics_user_map may or may not exist for every user.
# So we create a record just in case, even if the SQL fails. # So we create a record just in case.
db_transaction { set exists_p [db_string topic_map_exists "
db_dml im_forum_topic_user_map_insert " select count(*)
insert into im_forum_topic_user_map from im_forum_topic_user_map
(topic_id, user_id, read_p, folder_id, receive_updates) values where topic_id = :topic_id
(:topic_id, :user_id, :read_p, :folder_id, :receive_updates)" and user_id = :user_id
} on_error { "]
# nothing - may already exist... if {!$exists_p} {
db_transaction {
db_dml im_forum_topic_user_map_insert "
insert into im_forum_topic_user_map
(topic_id, user_id, read_p, folder_id, receive_updates) values
(:topic_id, :user_id, :read_p, :folder_id, :receive_updates)
"
} on_error {
# nothing - may already exist...
}
} }
...@@ -300,7 +309,6 @@ where ...@@ -300,7 +309,6 @@ where
} }
} }
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# Assign the ticket to a new user # Assign the ticket to a new user
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
...@@ -525,6 +533,7 @@ if {!$action_type_found} { ...@@ -525,6 +533,7 @@ if {!$action_type_found} {
} }
} }
# Send a mail to all subscribed users # Send a mail to all subscribed users
# #
set stakeholder_sql " set stakeholder_sql "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment