File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1136,7 +1136,7 @@ function bug_delete( $p_bug_id ) {
1136
1136
bugnote_delete_all ( $ p_bug_id );
1137
1137
1138
1138
# Delete all sponsorships
1139
- sponsorship_delete ( sponsorship_get_all_ids ( $ p_bug_id ) );
1139
+ sponsorship_delete_all ( $ p_bug_id );
1140
1140
1141
1141
# MASC RELATIONSHIP
1142
1142
# we delete relationships even if the feature is currently off.
Original file line number Diff line number Diff line change @@ -352,6 +352,23 @@ function sponsorship_set( $p_sponsorship ) {
352
352
return $ t_sponsorship_id ;
353
353
}
354
354
355
+ /**
356
+ * delete all sponsorships of a bug
357
+ * @param int $p_bug_id
358
+ * @return null
359
+ */
360
+ function sponsorship_delete_all ( $ p_bug_id ) {
361
+ $ c_bug_id = db_prepare_int ( $ p_bug_id );
362
+
363
+ $ t_sponsorship_table = db_get_table ( 'sponsorship ' );
364
+
365
+ $ query = "DELETE FROM $ t_sponsorship_table
366
+ WHERE bug_id= " . db_param ();
367
+ db_query_bound ( $ query , $ c_bug_id );
368
+
369
+ sponsorship_clear_cache ( );
370
+ }
371
+
355
372
/**
356
373
* delete a sponsorship given its id
357
374
* id can be an array of ids or just an id.
You can’t perform that action at this time.
0 commit comments