Author Topic: Can't collapse categories, duplicate entry database error  (Read 283 times)

Offline rayman488

  • Newbie
  • *
  • Posts: 2
Can't collapse categories, duplicate entry database error
« on: November 09, 2018, 11:59:22 AM »
Hey everyone, having an issue collapsing or minimizing new categories created.  All old categories collapse just fine, no issues.  I believe it might be due to the fact that I have over 250 categories on the forum.  I read an older post that claimed there was a 250 limit to the number of categories.  I don't know if this has anything to do with it or not, since I can still add the categories and new boards underneath them, just can not collapse them.  I get the following error:

Duplicate entry '255-2' for key 'PRIMARY'
File: /home/(account-directoy)/public_html/Sources/Subs-Categories.php
Line: 276

The line that it refers to in the php file is:
'is_collapsible' => 1,

I have the option checked to allow it to be collapsible and you can click on the minus symbol, but you always get that error.

I've copied the files and database to a new server to do testing and I've deleted 50+ old categories as well as some of the new ones too.  But as soon as you create a new one, it auto-numbers it in the database as 266, 267, 268... and it will not collapse.  Again, everything is working fine with it, just that one feature. 

I'm on version SMF 2.0.15, no mods install.  Brand new clean install, with import of database through phpmyadmin.  I've run all of the maintenance tools through the forum to clean things up, and check for errors.  Nothing seems to help.  Do you think it's because of the 250 limit, or has this gone away in newer versions.  If this is the case, can I manually increase it somehow.  Or how do I renumber or fix it?  Any ideas much appreciated.  I can't give a link to the forum as all of it requires a login to view.  Thanks again for any ideas.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,316
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can't collapse categories, duplicate entry database error
« Reply #1 on: November 09, 2018, 02:57:40 PM »
Yes, I believe that there is a hard limit to the number of categories (and I assume that you actually mean categories, not boards)

So, the first question is -- why do you have so many categories?
That many categories would make a forum basically unusable -- and is unnecessary in any realistic use case that I can imagine.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline rayman488

  • Newbie
  • *
  • Posts: 2
Re: Can't collapse categories, duplicate entry database error
« Reply #2 on: November 09, 2018, 03:12:56 PM »
Yes, you are correct.  It is the categories, not the boards. 

The forum was setup originally to track communications and store sales, etc. for a business with multiple stores all in one convenient place.  That is why it is set to private and I could not share the link.  Might not be the most correct use of the forum software but that is what they found the most useful and easy for them.  That being said, do you have a solution to the hard limit.  Is there some place to change this?  I have access to all of the server functions if it's something there.

If not, what might be the best method to copy the most recent data to a new install while leaving the old data behind, or on an archive site perhaps?  Thus allowing them to "press on" without the issue.  Thanks for the response.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,389
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Can't collapse categories, duplicate entry database error
« Reply #3 on: November 09, 2018, 03:13:24 PM »
Will require changing the database stcruture increasing the size of some of the columns
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more! -  Paid Modifications for SMF

EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 580
Re: Can't collapse categories, duplicate entry database error
« Reply #4 on: November 10, 2018, 04:29:38 AM »
Maybe as note for the future,
it's depend on used database.
MySQL setup allow 255 categories
PostgreSQL setup allow 32767 categories
sqlite (which is not supported in smf 2.1) setup allow 9223372036854775807 categories