[pLog-svn] r5563 - plog/branches/lifetype-1.2/class/dao
Oscar Renalias
oscar at renalias.net
Fri Jun 22 16:54:28 EDT 2007
The good thing is that this is now fixed and it works.
The bad thing is that those of you who have been using this feature
so far will have to fix data manually in the database to update the
category counters. Please keep in mind that it's not enough to update
the num_articles and num_published_articles field in the
lt_articles_category table, but you will also have to remove all the
unused rows from the lt_article_categories_link table, or else next
time you do a purge the amounts will be again wrong. This is because
those values are calculated every time the category is udpated based
on the data in the_link table. For example, the value of the
num_articles field is calculated as
SELECT COUNT(category_id) AS total FROM lt_article_categories_link
WHERE category_id = '6'
There is a similar (but more complex) query used to calculate the
data for the num_published_articles field.
Sorry about that, I guess it's going to be painful to modify all this
data manually (but feel free to write a script to do it for you)
On 22 Jun 2007, at 23:55, oscar at devel.lifetype.net wrote:
> Author: oscar
> Date: 2007-06-22 16:55:25 -0400 (Fri, 22 Jun 2007)
> New Revision: 5563
>
> Modified:
> plog/branches/lifetype-1.2/class/dao/articles.class.php
> Log:
> Part of the fix for purging articles, as the method for deleting
> the link between a category and an article was unfortunately not
> even being called.
>
> Modified: plog/branches/lifetype-1.2/class/dao/articles.class.php
> ===================================================================
> --- plog/branches/lifetype-1.2/class/dao/articles.class.php
> 2007-06-22 20:34:37 UTC (rev 5562)
> +++ plog/branches/lifetype-1.2/class/dao/articles.class.php
> 2007-06-22 20:55:25 UTC (rev 5563)
> @@ -1106,6 +1106,9 @@
> // delete the text
> $this->deleteArticleText( $artId );
>
> + // update the links with article categories
> + $this->deletePostCategoriesLink( $article );
> +
> // update global article categories
> $this->updateGlobalArticleCategoriesLink( $article );
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
More information about the pLog-svn
mailing list