collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 953
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Database Error: Field 'topblock' doesn't have a default value  (Read 3285 times)

0 Members and 1 Guest are viewing this topic.

Offline just2pale

  • Newbie
  • Posts: 3
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Database Error: Field 'topblock' doesn't have a default value
« on: November 22, 2010, 04:37:51 PM »
SMF 2.0 RC4
SimplePortal 2.3.3
http://forum.just2pale.com/index.php

I am having issues of adding new boards or categories to my forums. I keep getting this error report.

Database Error.

Field 'topblock' doesn't have a default value
File: D: \websites\just2pale\forum\Sources\Subs-Boards.php
Line: 785

I do not see the 'topblock' anywhere in the code and researching has not been that successful for me.
Any help would be appreciated,.

Code: [Select]
{
   global $boards, $modSettings, $smcFunc;

   // Trigger an error if one of the required values is not set.
   if (!isset($boardOptions['board_name']) || trim($boardOptions['board_name']) == '' || !isset($boardOptions['move_to']) || !isset($boardOptions['target_category']))
      trigger_error('createBoard(): One or more of the required options is not set', E_USER_ERROR);

   if (in_array($boardOptions['move_to'], array('child', 'before', 'after')) && !isset($boardOptions['target_board']))
      trigger_error('createBoard(): Target board is not set', E_USER_ERROR);

   // Set every optional value to its default value.
   $boardOptions += array(
      'posts_count' => true,
      'override_theme' => false,
      'board_theme' => 0,
      'access_groups' => array(),
      'board_description' => '',
      'profile' => 1,
      'moderators' => '',
      'inherit_permissions' => true,
      'dont_log' => true,
   );

   // Insert a board, the settings are dealt with later.
   $smcFunc['db_insert']('',
      '{db_prefix}boards',
      array(
         'id_cat' => 'int', 'name' => 'string-255', 'description' => 'string', 'board_order' => 'int',
         'member_groups' => 'string', 'redirect' => 'string',
      ),
      array(
         $boardOptions['target_category'], $boardOptions['board_name'] , '', 0,
         '-1,0', '',
      ),
      array('id_board')
   );
   $board_id = $smcFunc['db_insert_id']('{db_prefix}boards', 'id_board');

   if (empty($board_id))
      return 0;

   // Change the board according to the given specifications.
   modifyBoard($board_id, $boardOptions);

   // Do we want the parent permissions to be inherited?
   if ($boardOptions['inherit_permissions'])
   {
      getBoardTree();

      if (!empty($boards[$board_id]['parent']))
      {
         $request = $smcFunc['db_query']('', '
            SELECT id_profile
            FROM {db_prefix}boards
            WHERE id_board = {int:board_parent}
            LIMIT 1',
            array(
               'board_parent' => (int) $boards[$board_id]['parent'],
            )
         );
         list ($boardOptions['profile']) = $smcFunc['db_fetch_row']($request);
         $smcFunc['db_free_result']($request);

         $smcFunc['db_query']('', '
            UPDATE {db_prefix}boards
            SET id_profile = {int:new_profile}
            WHERE id_board = {int:current_board}',
            array(
               'new_profile' => $boardOptions['profile'],
               'current_board' => $board_id,
            )
         );
      }
   }

   // Created it.
« Last Edit: November 23, 2010, 09:16:17 AM by AngelinaBelle »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Database Error: Field 'topblock' doesn't have a default value
« Reply #1 on: November 27, 2010, 03:20:01 PM »
This is a very confusing one.  As far as I can tell, SimplePortal does not put a field 'topblock' on the database, and it does not modify the SMF table boards that you mention in that code snippet.
 
Which of those lines is 785, anyway?
 
What makes you certain that SimplePortal causes the problem?
Does the problem go away when you disable or uninstall SimplePortal?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline just2pale

  • Newbie
  • Posts: 3
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Database Error: Field 'topblock' doesn't have a default value
« Reply #2 on: November 27, 2010, 04:19:21 PM »
Below I marked where Line 785 is .. Which is NOTHING as you can see.

I am assuming that simple portal is the cause for it - as I did not have this problem before hand and simple portal uses terms as Top Block, Bottom Block, and so on.

Uninstalling or Disabling it now - has no effect on my error. The database now still looks for this Top Block no matter what.

I am just at a loss on what and how to fix this.

Thank you for replying.


Code: [Select]
{
   global $boards, $modSettings, $smcFunc;

   // Trigger an error if one of the required values is not set.
   if (!isset($boardOptions['board_name']) || trim($boardOptions['board_name']) == '' || !isset($boardOptions['move_to']) || !isset($boardOptions['target_category']))
      trigger_error('createBoard(): One or more of the required options is not set', E_USER_ERROR);

   if (in_array($boardOptions['move_to'], array('child', 'before', 'after')) && !isset($boardOptions['target_board']))
      trigger_error('createBoard(): Target board is not set', E_USER_ERROR);

   // Set every optional value to its default value.
   $boardOptions += array(
      'posts_count' => true,
      'override_theme' => false,
      'board_theme' => 0,
      'access_groups' => array(),
      'board_description' => '',
      'profile' => 1,
      'moderators' => '',
      'inherit_permissions' => true,
      'dont_log' => true,
   );

   // Insert a board, the settings are dealt with later.
   $smcFunc['db_insert']('',
      '{db_prefix}boards',
      array(
         'id_cat' => 'int', 'name' => 'string-255', 'description' => 'string', 'board_order' => 'int',
         'member_groups' => 'string', 'redirect' => 'string',
      ),
      array(
         $boardOptions['target_category'], $boardOptions['board_name'] , '', 0,
         '-1,0', '',
      ),
      array('id_board')
   LINE 785 );
   $board_id = $smcFunc['db_insert_id']('{db_prefix}boards', 'id_board');

   if (empty($board_id))
      return 0;

   // Change the board according to the given specifications.
   modifyBoard($board_id, $boardOptions);

   // Do we want the parent permissions to be inherited?
   if ($boardOptions['inherit_permissions'])
   {
      getBoardTree();

      if (!empty($boards[$board_id]['parent']))
      {
         $request = $smcFunc['db_query']('', '
            SELECT id_profile
            FROM {db_prefix}boards
            WHERE id_board = {int:board_parent}
            LIMIT 1',
            array(
               'board_parent' => (int) $boards[$board_id]['parent'],
            )
         );
         list ($boardOptions['profile']) = $smcFunc['db_fetch_row']($request);
         $smcFunc['db_free_result']($request);

         $smcFunc['db_query']('', '
            UPDATE {db_prefix}boards
            SET id_profile = {int:new_profile}
            WHERE id_board = {int:current_board}',
            array(
               'new_profile' => $boardOptions['profile'],
               'current_board' => $board_id,
            )
         );
      }
   }

   // Created it.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Database Error: Field 'topblock' doesn't have a default value
« Reply #3 on: November 29, 2010, 08:37:07 AM »
Actually, that line is important.  It is the last bit of the call to db_insert, which is supposed to be inserting a new row into that table boards.
 
Can you check that table boards and find out if it contains a field called topblock?
 
This is a very strange error.
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline just2pale

  • Newbie
  • Posts: 3
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Database Error: Field 'topblock' doesn't have a default value
« Reply #4 on: November 29, 2010, 02:58:12 PM »
yes it does have a field topblock. I did a backup of the database and in viewing this I found that field.

I am viewing the existing boards in the data base, and topblock field is just  '  '  no value is given for any of them, but this is just for existing boards already.

So I'm not sure where/how it's messing up for creating a new board.

Code: [Select]
CREATE TABLE `pale_boards` (
 `id_board` smallint(5) unsigned NOT NULL auto_increment,
 `id_cat` tinyint(4) unsigned NOT NULL default 0,
 `child_level` tinyint(4) unsigned NOT NULL default 0,
 `id_parent` smallint(5) unsigned NOT NULL default 0,
 `board_order` smallint(5) NOT NULL default 0,
 `id_last_msg` int(10) unsigned NOT NULL default 0,
 `id_msg_updated` int(10) unsigned NOT NULL default 0,
 `lastUpdated` int(11) unsigned NOT NULL default 0,
 `member_groups` varchar(255) NOT NULL default '-1,0',
 `id_profile` smallint(5) unsigned NOT NULL default 1,
 `name` varchar(255) NOT NULL default '',
 `description` text NOT NULL,
 `num_topics` mediumint(8) unsigned NOT NULL default 0,
 `num_posts` mediumint(8) unsigned NOT NULL default 0,
 `count_posts` tinyint(4) NOT NULL default 0,
 `id_theme` tinyint(4) unsigned NOT NULL default 0,
 `override_theme` tinyint(4) unsigned NOT NULL default 0,
 `topicSolved` tinyint(4) NOT NULL default 0,
 `is_rated` tinyint(4) NOT NULL default 0,
 `topblock` text NOT NULL,
 `allowThumbsUps` tinyint(4) unsigned NOT NULL default 0,
 `redirect` varchar(255) NOT NULL default '',
 `unapproved_posts` smallint(5) NOT NULL default 0,
 `unapproved_topics` smallint(5) NOT NULL default 0,
 `admin1` tinyint(1) NOT NULL,
 `twitter_enable` tinyint(1) unsigned NOT NULL default 1,
 `twitter_tpl_enable` tinyint(1) unsigned NOT NULL default 0,
 `twitter_tpl_text` text NOT NULL,
 `twitter_twitter_acc_enable` tinyint(1) unsigned NOT NULL default 0,
 `twitter_twitter_acc_username` varbinary(15) NOT NULL default '',
 `twitter_twitter_acc_password` varbinary(35) NOT NULL default '',
 PRIMARY KEY (`id_board`),
 UNIQUE `categories` (`id_cat`, `id_board`),
 KEY `ID_PARENT` (`id_parent`),
 KEY `ID_MSG_UPDATED` (`id_msg_updated`)
) ENGINE=MyISAM;

--
-- Dumping data in `pale_boards`
--

INSERT INTO `pale_boards`
(`id_board`, `id_cat`, `child_level`, `id_parent`, `board_order`, `id_last_msg`, `id_msg_updated`, `lastUpdated`, `member_groups`, `id_profile`, `name`, `description`, `num_topics`, `num_posts`, `count_posts`, `id_theme`, `override_theme`, `topicSolved`, `is_rated`, `topblock`, `allowThumbsUps`, `redirect`, `unapproved_posts`, `unapproved_topics`, `admin1`, `twitter_enable`, `twitter_tpl_enable`, `twitter_tpl_text`, `twitter_twitter_acc_enable`, `twitter_twitter_acc_username`, `twitter_twitter_acc_password`)
VALUES (33, 4, 0, 0, 1, 83585, 83585, 0, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Forum Rules', 'Like it says...', 1, 1, 1, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(7, 4, 0, 0, 2, 106686, 106686, 1146358818, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'All about just2pale', 'what you don\'t want to know!', 1, 29, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(6, 4, 0, 0, 3, 106899, 106899, 1147726560, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Noobs', 'Intro yourself', 11, 850, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(31, 8, 0, 0, 4, 77391, 77391, 0, '', 10, 'Updates', 'well duh', 21, 219, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(32, 8, 0, 0, 5, 106705, 106705, 0, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Animation Related', ' - Tutorials, Anime, Games, Sketches', 22, 973, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(37, 8, 0, 0, 6, 106923, 106923, 0, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Movies', 'Talk about them', 26, 542, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(38, 8, 0, 0, 7, 106903, 106903, 0, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Music', 'sing to me', 9, 429, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(1, 8, 0, 0, 8, 106964, 106964, 1147729354, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'General BS', 'Feel free to talk about anything and everything in this board.', 662, 33705, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', ''),
(39, 9, 0, 0, 9, 106251, 106251, 0, '-1,0,10,11,9,2,13,4,12,5,6,7', 10, 'Errors on Forums', 'Please report all errors you may come across here.', 2, 27, 0, 0, 0, 0, 0, '', 0, '', 0, 0, 0, 1, 0, '', 0, '', '');

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Database Error: Field 'topblock' doesn't have a default value
« Reply #5 on: November 29, 2010, 03:04:01 PM »
The question is -- which mod put that field 'topblock' on the table '{db_prefix}boards'?
That table definition requires that that field not to be null.
 
 SimplePortal does not muck around with the boards table.  SimplePortal did not cause this.

One possible workaround is remove the "not NULL" requirement from the table definition.  You can do this if you have a mySQL admin tool of some sort, or by creating a php file to do the one SQL query you want done. Or, barring that, by creating a backup file that only contains the Drop, Create, and INSERT statements for that table, and restoring that itty-bitty-backup.
 
It seems likely that this 'topblock' field comes from some other mod or manual customization, and that the code for that mod was eliminated in the upgrade to RC4, resulting in a table that wants the 'topblock' field populated, but no code to do that...
 
 
« Last Edit: November 30, 2010, 05:35:11 PM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?