News:

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

Main Menu

How to fix "Field 'id' doesn't have a default value" Database Error?

Started by etc2015, March 15, 2015, 04:34:30 AM

Previous topic - Next topic

etc2015

Hello, I'm new here but I have been managing an SMF forum for about 3 years now with the help of this community (just browsing for solutions).  But for this issue, I can't seem to find any solution so I'm posting it here for help/support from the SMF veterans/experts 

I have disabled member registration because of previous database issues.  I needed to upgrade and I did I while ago (large upgrade to SMF 2.0.9).  A lot of issues were solved but I still can't register new members. 

The following message appears whenever I tried to register a new member:

Field 'fbname' doesn't have a default value
File: /home/treasure/public_html/mywebsite.com/forum/Sources/Subs-Members.php
Line: 772


Looking forward to anyone's help.  :'(

Illori

do you have any mods installed? fbname does not show up in a clean set of files.

etc2015

As of now, I only have 2 mods installed:

1.    Fake Topic Views    0.1
2.    EzPortal    3.0.3

I stopped reinstalling mods after the large upgrade when I found out about this database error.  :(

Kindred

Well, from the name, it would appear that you have a partially installed facebook mod...
Сл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."

etc2015

Actually I do have this installed before but not anymore:

7.    Add Facebook Like to Posts    1.1    [ Install Mod ] [ List Files ] [ Delete ]

I'll try deleting it (and all other unused mods) and see how it goes. 

etc2015

Quote from: Kindred on March 15, 2015, 11:02:26 PM
Well, from the name, it would appear that you have a partially installed facebook mod...

I still have errors after deleting the uninstalled FB mod.  Can you show me where I can possibly find this (i.e. partially installed facebook mod) and how can I delete it or take if off the system completely.  :)

Illori

did you use repair_settings.php or fix_packages.php to remove hooks? if you have not uninstall all your mods and use one of those files to remove the hooks and try again.

margarett

That will probably not help, if the error is the same :(

That's a file edit to Subs-Members.php that wasn't removed at uninstall. I can't find that MOD so please attach that file ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Illori

well it cant hurt to make sure all hooks are removed anyway, in case there were any.

Kindred

Deleting the mod package does not uninstall it.

It would seem that when you uninstalled, you ignored some error messagesthat told you that the mod was not going to completely uninstall....

Now you are going to have to MANUALLY remove any code edits...  by looking at the install instructions in reverse.
Hopefully you still have a copy of that mod file around so you can put it back into the package directory.
Сл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."

etc2015

Quote from: Illori on March 16, 2015, 05:24:04 AM
did you use repair_settings.php or fix_packages.php to remove hooks? if you have not uninstall all your mods and use one of those files to remove the hooks and try again.

I don't know how to use that two (i.e. repair_settings.php or fix_packages.php ) to remove hooks.  I did use repair_settings.php once but only to fix my forum when it got stuck in maintenance mode. But I'm willing to give it a try.  :)

etc2015

Quote from: Kindred on March 16, 2015, 06:39:02 AM
Deleting the mod package does not uninstall it.

It would seem that when you uninstalled, you ignored some error messagesthat told you that the mod was not going to completely uninstall....

Now you are going to have to MANUALLY remove any code edits...  by looking at the install instructions in reverse.
Hopefully you still have a copy of that mod file around so you can put it back into the package directory.

Okay, I'll give this a try too and see how it goes. Thanks  :)

etc2015

hello again... just an update...

I did remove all hooks using fix_packages.php but it didn't fix the problem.

I tried to figure out how to do this fix but didn't still don't have a clue on how to proceed (I'm really a noob at this coding thing). :( 

QuoteNow you are going to have to MANUALLY remove any code edits...  by looking at the install instructions in reverse.
Hopefully you still have a copy of that mod file around so you can put it back into the package directory.

I also need to figure out which mod is really causing the error.  I also just assumed it's the "Add Facebook Like to Posts" mod because of the field id name (i.e. fbname).  But is this really the mod causing it.

I also want to ask if my problem is this:

Field 'fbname' doesn't have a default value
File: /home/treasure/public_html/mywebsite.com/forum/Sources/Subs-Members.php
Line: 772


then can I just assign a default value to make the error go away? or will it just mess it up even more?  :-[ 

At first, Looking at the error (with my untrained noob eyes), I thought that I can fix it by just finding that line 772 and do some code editing.  :( 

Can anyone please be kind and patient enough to give me the basic steps on how to do this >> "manually remove code edits by looking at the install instructions in reverse." 

I tried searching for a tutorial on how to go about this but this is the only info that I got so far (no help at all for a newbie like me):
http://www.simplemachines.org/community/index.php?topic=489224.0





ziycon

Can you attach a copy of your Subs-Members.php file here so we can have a look at it for you?

etc2015

Quote from: ziycon on March 18, 2015, 05:00:15 AM
Can you attach a copy of your Subs-Members.php file here so we can have a look at it for you?

Please see attached.  Thanks, I really appreciate all the help.  :).

ziycon

Looks like you have a column on the {prefix}members table called 'fbname' and it doesn't have a default value set against it so when you try to run an insert on the members table and don't pass any value in for the 'fbname' column it errors with what you're seeing above.

If you have removed the mod that added fbname then you can run a drop column command on the table like:
ALTER TABLE {prefix}members DROP COLUMN fbname;

** N.B. **
Backup your database before running anything that will alter the database structure or contents!

etc2015

Quote from: ziycon on March 25, 2015, 04:39:20 AM
Looks like you have a column on the {prefix}members table called 'fbname' and it doesn't have a default value set against it so when you try to run an insert on the members table and don't pass any value in for the 'fbname' column it errors with what you're seeing above.

If you have removed the mod that added fbname then you can run a drop column command on the table like:
ALTER TABLE {prefix}members DROP COLUMN fbname;

** N.B. **
Backup your database before running anything that will alter the database structure or contents!


I will give this a try.  Thanks Ziycon.  :)

margarett

etc2015 I marked this as solved as we haven't heard back from you. Let us know if you still have problems ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

etc2015

Quote from: margarett on April 15, 2015, 07:18:22 PM
etc2015 I marked this as solved as we haven't heard back from you. Let us know if you still have problems ;)

Thanks Margarett and sorry for not posting any updates here (I was about to today and saw your post  :-[ ). 

I've been very busy for the past weeks and it is only today that I have the time to focus and try fixing my forum again.  I'm actually still waiting for my "more techie" friend to help me with this but since I haven't heard from him until now, I will give this a try by myself (fingers crossed :-\ ).   I'll give updates the soonest possible time. 

etc2015

Quote from: ziycon on March 25, 2015, 04:39:20 AM
Looks like you have a column on the {prefix}members table called 'fbname' and it doesn't have a default value set against it so when you try to run an insert on the members table and don't pass any value in for the 'fbname' column it errors with what you're seeing above.

If you have removed the mod that added fbname then you can run a drop column command on the table like:
ALTER TABLE {prefix}members DROP COLUMN fbname;

** N.B. **
Backup your database before running anything that will alter the database structure or contents!


UPDATES:

I dropped the column "fbname" thru my cPanel's PHPMyAdmin (I'm afraid to do it manually).  The problem went away and now I can register new members smoothly.  :D 

Thanks again Ziycon and to all those who took their time to post their inputs here.  :-*

More power to SMF and God Bless all the SMF veterans/experts who are always there to help newbies like me.  :)

Problem SOLVED!

Advertisement: