ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

exp_category_posts table not updated

August 13, 2009 9:50am

Subscribe [3]
  • #1 / Aug 13, 2009 9:50am

    Laisvunas's avatar

    Laisvunas

    879 posts

    Hi,

    I encountered a behavior which perhaps might be considered a bug - exp_category_posts table not updated when one would expect it to be updated.

    Let me describe an example of such behavior.

    Say you have a category which has category id 260. Then you post into that category an entry, which has entry id 3377. Then if you run the code

    {exp:query sql="SELECT cat_id FROM exp_category_posts WHERE entry_id = '3377'"}
    {cat_id}
    {/exp:query}

    the category id of the entry will be displayed.

    Now say you create a category which has category id 261 and after that you make this category the parent of the category 260.

    Having made such changes you would expect that the code above will display both category ids - 260 and 261. But instead it will display only 260 as earlier.

    Both category ids will be displayed only in case the entry 3377 will be updated after category 261 was made the parent of the category 260.

    It seems to me that such behavior is not good; it seems that after some category was made a parent of some other category, the table exp_category_posts should be updated accordingly to reflect the change.

  • #2 / Aug 13, 2009 10:09am

    Sue Crocker's avatar

    Sue Crocker

    26054 posts

    Version of EE and build?

  • #3 / Aug 13, 2009 10:11am

    Laisvunas's avatar

    Laisvunas

    879 posts

    Hi Sue,

    I use EE 1.6.8 Build:  20090723.

  • #4 / Aug 13, 2009 12:02pm

    Sue Crocker's avatar

    Sue Crocker

    26054 posts

    I had to actually go edit the article and resave it to have this work. Is that what you mean?

  • #5 / Aug 13, 2009 12:32pm

    Laisvunas's avatar

    Laisvunas

    879 posts

    Hi Sue,

    Yes, I meant exactly that.

    It seems to me that all categories should be found without the need of resaving.

  • #6 / Aug 13, 2009 3:08pm

    Robin Sowell's avatar

    Robin Sowell

    13233 posts

    I’d say this would fall more into the category of a feature request- and I personally would envision it working more along the lines of the ‘recount’ feature. 

    The current behavior is in keeping with the way most such settings work.  For example- changing the separator in url titles only applies to the future- or changing the formatting on a custom field gives you the option of applying it retroactively, but doesn’t do so automatically.

    Which was a long rambly way of saying- it’s intended behavior and wouldn’t fall into the category of a bug.  But it might make a good FR to add a ‘sync’ option a la how changing field formatting works.  At least, that’s how I’d envision it working.

  • #7 / Aug 14, 2009 7:50am

    Laisvunas's avatar

    Laisvunas

    879 posts

    Hi Robin,

    I would not agree that the analogy between changing the separator in url titles or changing the formatting on a custom field and updating exp_category_posts table is perfect; but such disagreement, of course, is of no importance.

    Posted feature request here.

  • #8 / Aug 14, 2009 10:24am

    Ingmar's avatar

    Ingmar

    29245 posts

    Glad to see we got to the bottom of this. Looks like an FR is indeeed your best option at this point. Please don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases