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.

Getting default categories assigned when set to "none"

July 08, 2011 10:54am

Subscribe [10]
  • #1 / Jul 08, 2011 10:54am

    struiling

    10 posts

    I’m on EE 2.1.4 build 20110201, and have a number of channels, some of which have default categories, and some of which don’t. The ones that don’t are getting default categories (2) applied to them on entry creation. The ones with a set default category are working as intended. I tried giving a default category to the ones without a default and switching back, but it doesn’t make a difference. Any ideas? Thanks!

    [edit] I really don’t want to upgrade to 2.2, but if there’s a way to get 2.1.5, I can do that.

  • #2 / Jul 10, 2011 11:30am

    Sue Crocker

    26054 posts

    Hi, struiling, we don’t keep older builds/versions for download with the exception of EE1.7.1. You’d need to upgrade to 2.2.1.

  • #3 / Jul 10, 2011 9:08pm

    struiling

    10 posts

    Thanks Sue, I figured. Was that a known bug, or can you at least confirm that having no default category set works in 2.2.1?

  • #4 / Jul 11, 2011 5:35pm

    Brandon Jones

    5500 posts

    Hi struiling,

    I haven’t been able to replicate this issue on 2.2.1.

  • #5 / Oct 02, 2011 9:05am

    ruraldreams

    279 posts

    I am seeing this in a site that I just upgraded to 2.2.2 from 1.6 - could it be a publish layout issue?  In this case it’s defaulting to four categories and their parent.  I’m not even sure how you’d do that if you WANTED to.

  • #6 / Oct 03, 2011 12:37pm

    Mark Bowen

    12637 posts

    @ruraldreams

    To set a default category for a Channel you would go to Admin > Channel Administration > Channels > Edit Preferences (Your Channel Name) > Administrative Preferences[/b]

    There you should see an option for a Default Category.

    Do you have anything selected there at all?

    @strulling

    Just to say that I’m not seeing this issue on 2.2.2 either. Did you by any chance ever do any imports of data on this site perhaps using Datagrab?

    Thanks,

    Mark

  • #7 / Oct 03, 2011 12:40pm

    ruraldreams

    279 posts

    No, nothing is selected there and it is defaulting to multiple categories checked—it is happening on approximately half of the channels.  I’ve tried unchecking them and saving the publish layout and this hasn’t fixed it.

  • #8 / Oct 04, 2011 12:44pm

    Mark Bowen

    12637 posts

    Hi ruraldreams,

    Did you perform any data imports to this site at all as I’ve seen that affect categories before.

    Thanks,

    Mark

  • #9 / Oct 04, 2011 1:36pm

    ruraldreams

    279 posts

    No imports, it’s an upgrade.  If you could tell me where in the DB this might be set, we could write a query to clear them out perhaps.  I’m having trouble finding their source.

  • #10 / Oct 05, 2011 5:47pm

    Dan Decker

    7338 posts

    ruraldreams,

    Categories are associated with entries in exp_category_posts. We do not advise running queries of that nature directly on the database. If you choose to do so, please make a backup *before* any changes in the event you need to roll back.

    Cheers,

  • #11 / Oct 10, 2011 5:35pm

    Ditchmonkey

    53 posts

    I’m having this same problem and unfortunately updating EE to the latest version did not fix it. Any new info on this? Or more detailed instructions on what to do the exp_category_posts to resolve this issue?

  • #12 / Oct 10, 2011 5:41pm

    ruraldreams

    279 posts

    Paul fixed this problem for us today.  My understanding is that new entries are assigned an entry_id of 0.  Somehow, after the upgrade, we had categories associated with this entry_id.  We had to clear those out in the DB.  If that’s not clear I’ll see if I can get him to explain further.

  • #13 / Oct 11, 2011 10:20am

    Mark Bowen

    12637 posts

    Hi ruraldreams,

    Very glad that you got this sorted with Paul’s help (which Paul is that by the way?).

    If you could let us know exactly what happened here then that would be great thanks.

    Mark

  • #14 / Oct 11, 2011 11:41am

    Paul Burdick

    480 posts

    This Paul.

    We do not advise running queries of that nature directly on the database.

    That cracks me up.  Whatever happened to actually looking at the site and investigating a customer’s problem?

    ——

    The problem is that exp_category_posts had rows in the table with an entry_id of 0.  The Publish library has a bug in it, where if there are no default categories and no POST data coming in, it looks for categories in the database for the entry.  This still happens for new entries, and it looks for an entry_id of 0.  Naturally, this causes new entries on this client’s site to have categories selected by default, based on the ones in exp_category_post with an entry_id of 0.

    Now, I looked at this client’s DB backup prior to the EE 1.x to EE 2.x upgrade.  exp_category_posts has no rows where entry_id equals 0.  So, at some point during the upgrade, those rows seem to have gotten added.  Not sure if this is the EL upgrade script or another upgrade script.

    I have fixed this client’s site by removing those exp_category_posts rows.  I will file a bug report for the Publish library.  As for the cause of the exp_category_posts, I leave that up to your developers.

  • #15 / Oct 11, 2011 12:04pm

    Kurt Deutscher

    827 posts

    I miss seeing your posts in the forums Paul. Hope you stop by and post more often. The community could use your insights and clarity.

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

ExpressionEngine News!

#eecms, #events, #releases