News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Can't collapse categories, duplicate entry database error

Started by rayman488, November 09, 2018, 11:59:22 AM

Previous topic - Next topic

rayman488

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.

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rayman488

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.

vbgamer45

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!

SMFHacks.com -  Paid Modifications for SMF

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

albertlast

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

Advertisement: