News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problem creating new category.

Started by Panoulis64, April 18, 2023, 11:16:46 AM

Previous topic - Next topic

Panoulis64

After many years and many upgrades, I needed to create a new category, without success.
I get fatal error:
Database error: Field 'cat_color' doesn't have a default value
INSERT INTO smf_categories(`name`, `description`)
VALUES
(SUBSTRING('Sports Clubs of Trigliano', 1, 48), 'Record us the action of our clubs and athletes.')

In public_html/Sources/Subs-Categories.php (Line 181)
I downloaded smf_2-1-3_install.zip unzipped it and looked for a difference on line 181 and there wasn't.
What could be going on?

Arantor

SMF 2.1 doesn't have a category colour field (cat_color is not a column in the table by default) so it's a mod from before the 2.1 upgrade that didn't get cleanly fixed.

Presumably you don't still have that mod (or some version of it) so you could update the table in phpMyAdmin to make the column 'null' (empty) by default, or even remove the column entirely since the mod is almost certainly long gone.
Holder of controversial views, all of which my own.


Panoulis64

Thank you so much for the reply.
Since I don't know from the management of c Panel , to ask if it is safe, to delete tables of the style backup_smftm_admin_info_files because for some reason I see them in phpMyAdmin as duplicates (With the addition of backup_ and without it).
Also boards from old mods that I don't use or had trial installed.
To solve the problem and lighten the database.

Arantor

So, the backup_ tables are copies of the tables made during upgrade in case the upgrade goes wrong or you want to undo the upgrade. If everything else is working you can delete them.

You need to edit the *current* database table, not the one marked backup_.

In any case, the "load" of the backup is just space used, it doesn't make the database slower to have the extra tables. Deleting them will *not* fix this problem.
Holder of controversial views, all of which my own.


Panoulis64

Yes I understand, but I also have mod tables like e.g. backup_smf_2sichat and smf_2sichat which I don't use for years or smf_adk_blocks or smf_arcade_games etc. For them I mention, in case the problem is solved.

Panoulis64

Problem solved
Finally found it 'cat_color'
Forgotten by old application and we were really lucky to find it.

Advertisement: