sNews Forum

Previous sNews versions => sNews 1.5 Final => Bug Report => Topic started by: mosh on March 31, 2007, 02:45:22 pm

Title: delete category ?
Post by: mosh on March 31, 2007, 02:45:22 pm
hey all :)

on my site (http://cms-zen.com/) i had a category i deleted, then i saw all articles
from that category was not deleted but now has a url of home/name-of-article,
i can not see those articles in admin panel, or site map,
i can see those articles listed in the archive page :o

(http://img358.imageshack.us/img358/2603/catslf7.gif)

any idea ?????


awesome day
mo
Title: delete category ?
Post by: philmoz on March 31, 2007, 03:07:47 pm
category deletion does not remove the 'contained' articles.
On deletion, articles lose their category assignment, and return to the 'Home" psuedo category
Title: delete category ?
Post by: mosh on March 31, 2007, 03:21:05 pm
hey philmoz, thanks

so if i wanted to delet all articles in category and the category it self,
would i have to go to phpmyadmin to that ??

think its worth a mod hehe
awesome day/night to all
mo
Title: delete category ?
Post by: philmoz on March 31, 2007, 03:30:01 pm
various ways to do it.
1. give no option, just remove articles from db when delete is confirmed for category.
2. option to delete or not articles in category.
3. checkbox next to each article in admin view, with optional delete button (Delete Selected), for bulk article delete, prior to category deletion. (remainder would then be thrown into psuedo cat 'Home')

I have a bit on my plate at present...  :P  
care to have a go?
Title: delete category ?
Post by: mosh on March 31, 2007, 03:37:32 pm
hehe bonapetit  :D
for start i think i will try option 2,
its easy and simple function for end user

very good idea philmoz  :cool:
thanks
mo
Title: delete category ?
Post by: piXelatedEmpire on April 02, 2007, 01:25:18 am
Quote from: philmoz
category deletion does not remove the 'contained' articles.
On deletion, articles lose their category assignment, and return to the 'Home" psuedo category
Hmm that's an interesting decision... I've never played around with deleting a category while it had articles assigned to it.. what would be a good idea would be to have an option to either a) delete all articles assigned to the category being deleted or b) re-assign the articvles to a different category.
Title: delete category ?
Post by: philmoz on April 02, 2007, 10:47:34 am
eh-hem um, pix, 2 posts up ;)
Title: delete category ?
Post by: mosh on April 02, 2007, 01:25:56 pm
so far i did a button to delete all articles in cat,
but then i realised that i need to delete comments that are
attached to those articles  :P

 awesome day to all
mo
Title: delete category ?
Post by: mosh on April 03, 2007, 01:49:51 pm
update on the deleted category:

in phpmyadmin, i wanted to delete those articles
from the category that i have deleted via the snews admin cp,

i have noticed:
category was deleted, it does not show in category table.
(http://img393.imageshack.us/img393/9597/cattblvs1.jpg)

all articles in that cat, still have the deleted category ID listed in the article table
(http://img267.imageshack.us/img267/1723/arttblfg3.jpg)

wasn't the artlicles get new category id  ?

awesome day to all :cool:
mo
Title: delete category ?
Post by: codetwist on April 03, 2007, 06:20:23 pm
May be in theory that id has to cleared (like set category=0), but what is in code should and works as You described, mo  ;)  Actually, I think that reasonable approach to handle articles on deletion of category would be to un-publish them (set publish=0) to ensure that site's home page isn't flooded with whatever was under category deleted.

AFAIK same story is valid for deletion of articles as statement for deleting all related comments ends with option 'LIMIT 1'. Thus only first related comment will be deleted ;)
Title: delete category ?
Post by: mosh on April 03, 2007, 06:58:09 pm
you are right codetwist,  the Unpublish option is a good one to add to the list of option needed for manage larg amount of articles + comments  :cool:

awesome day 2 all  :D
Title: delete category ?
Post by: piXelatedEmpire on April 04, 2007, 01:39:39 am
I'm following this thread with interest mo and codie... and I think your ideas about unpublishing articles when category is deleted is an excellent one  :cool:
Title: delete category ?
Post by: mosh on April 04, 2007, 09:15:36 am
i guess those functions are needed   :D

i have added to my test installtion a button to delete cat,arts,comments
all are deleted nice from the site, but the comments still left in database humm  :P

ill do some more exploring today  :D
very cool day to all
mo
Title: Re: delete category ?
Post by: Keyrocks on July 23, 2008, 07:48:25 pm
For anyone who may come upon this thread wanting a "fix" for lost content after deleting a Category... this has been fixed with a minor modification now assigns "unpublished" status to content associated with a Category that has been deleted. The content remains listed in the Articles View list and can then be edited and re-located to another category from there. These changes were added to the official sNews 1.6 download on July 23.08.
Title: Re: delete category ?
Post by: Nicu Alecu on July 24, 2008, 05:38:49 pm
Keyrocks, you busy little bee, you ...  ;D
Maybe it's not the right place to ask, but is there a DIFF version of the applied patches?
Cause I really don't want to start modding and altering yet another snews.php file on my installs ... or maybe the patches are too complicated to be applied separately?
Title: Re: delete category ?
Post by: Keyrocks on July 24, 2008, 09:27:07 pm
Keyrocks, you busy little bee, you ...  ;D
Maybe it's not the right place to ask, but is there a DIFF version of the applied patches?
Cause I really don't want to start modding and altering yet another snews.php file on my installs ... or maybe the patches are too complicated to be applied separately?

There are two versions of the patches...
1 - for a default sNews 1.6 that also works OK with a default 1.6.3MU package... both of which only assign articles to categories.
2 - and a slightly different one for any sNews 1.6 version that assigns articles to Categories & SubCategories (using Equilni's Subcategories mods).

Which one do you need?
Title: Re: delete category ?
Post by: Nicu Alecu on July 25, 2008, 11:07:14 am
The first one would do jut fine, thank you!
Title: Re: delete category ?
Post by: Keyrocks on July 25, 2008, 02:23:45 pm
The first one would do jut fine, thank you!

Directions for making these Patches manually are shown here (http://snewscms.com/forum/index.php?topic=7552.msg53866#msg53866).
Title: Re: delete category ?
Post by: Nicu Alecu on July 28, 2008, 06:42:16 am
Thanks Keyroks, I'll get right to it.