Author Topic: Updating Post's Group Column When Deleting a News Module Group  (Read 517 times)

Offline gokcer

  • Posts: 94
When deleting a group in News module, the "group" database column of the posts those belong to that group still have its group_id.

On modules/news/delete_group at line 33-36 there is a query to update the posts' group ids to zero.

Code: [Select]
$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_news_posts` SET '
          . '`group_id`=0, '
          . 'WHERE `group_id` = '.$database->escapeString($group_id);
    $database->query($sql);

But it doesn't work (maybe on some servers) with no error.

By deleting the comma at line 34 it should work:

Code: [Select]
. '`group_id`=0 '

Offline jacobi22

  • Posts: 5891
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Updating Post's Group Column When Deleting a News Module Group
« Reply #1 on: June 12, 2017, 10:19:37 AM »
Thanks for the hint   (Y) (Y)

wondering, that nobody has problems with this before  :roll:

here the fixed file -> http://project.WebsiteBaker.org/projects/wb-2-10/repository/raw/branches/wb/modules/news/delete_group.php

a module upgrade comes in the next hours
Wer nicht will, findet Gründe, wer will, findet Wege.