Skip to content

Commit

Permalink
Merge pull request #19 from backdrop-contrib/alanmels-patch-1
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
alanmels committed Dec 27, 2022
2 parents 745e535 + c8fe84e commit a827450
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simplenews.module
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ function simplenews_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'taxonomy_vocabulary_confirm_delete') {
if (isset(taxonomy_get_tree(arg(3))[0]->tid)) {
$tid = taxonomy_term_load_multiple(taxonomy_get_tree(arg(3))[0]->tid);
$found = db_query("SELECT tid as min_id FROM {simplenews_category} WHERE {tid} = $tid->tid")->fetchField();
$found = db_query("SELECT tid as min_id FROM {simplenews_category} WHERE tid = $tid->tid")->fetchField();
if (!empty($found)) {
backdrop_set_message(t('If you want to delete the newsletter category, disable the Simplenews module first.'), 'error');
backdrop_goto('admin/structure/taxonomy');
Expand All @@ -777,7 +777,7 @@ function simplenews_form_alter(&$form, &$form_state, $form_id) {
}
if (arg(0) == 'taxonomy' && is_numeric(arg(2))) {
$tid = arg(2);
$found = db_query("SELECT tid as min_id FROM {simplenews_category} WHERE {tid} = $tid")->fetchField();
$found = db_query("SELECT tid as min_id FROM {simplenews_category} WHERE tid = $tid")->fetchField();
if (!empty($found)) {
if (arg(3) == 'edit') {
// For some reason backdrop_goto($path) is not working;
Expand Down

0 comments on commit a827450

Please sign in to comment.