News:

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

Main Menu

upgrade database

Started by Omebolle, April 22, 2019, 09:04:58 AM

Previous topic - Next topic

Omebolle

#20
Wow, think I found it, you mean this?
// 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')

Kindred

so, there is no insert there for the passwd column...   which means whatever mod you had is probably uninstalled...

however, the error clearly shows that there IS a passwd column in the smf_boards table...

So, if you can't see one in phpmyadmin, then that suggests that either you are looking at the wrong database or something is hokey
Сл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."

Omebolle

First of all, thanks for trying to help..
As I said, I am a rookie, I stayed far from trying to install complicated stuff...
I can't remember I ever tried to or did install a mod where you have to use a password to get into a board (nowhere to be seen in downloaded packages) It almost looks like it came with the board I installed?.
I use member groups for certain boards (always have). Therefore I have NO idea how the files of a password board came up in. What I did notice however is that the files have the SAME timestamp as the date I first installed the forum (see list). Never had any problems adding new boards in the years after, so why now?
Are there other files you want me to check? The second screen is of my CP on the server One.com and the link where I looked up the file you asked me to

Omebolle

Finally... Didn't understand what you meant with this "File: /customers/1/f/5/xxx.xxx/Sources/Subs-Boards.php"

Now I went to check through Filezilla which I use to upload files to the website and there I recognized the path you mentioned. There I can indeed see the PasswdBoard.php in the files with the 2014 date
This is the code I see in the Subs-Boards.php there, but I cannot open it with line numbers visible, only with notepad

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(

Tonyvic

The editor I use is Notepad++ and it will show line numbers. :)
https://notepad-plus-plus.org/download/v7.6.6.html

Omebolle

#25
Thks, will try that, but I'm pretty sure that's the part Kindred was talking about before (edit: Yep, just checked with that new notapad)

Kindred

#26
Yes, that file and code....

Welcome to the world of webmastering.

So, because the files are there, the PasswdBoard.php in the Sources and the PasswdBoard.template.php in the themes directories, that does prove that you HAD the mod installed at some point.   We won't even bother to figure out why or when, since it's not relevant.
https://custom.simplemachines.org/mods/index.php?mod=2873

In Subs-Boards.php do a search for 'passwd' ---  if it is not present anywhere in that file, then the mod was uninstalled.

However, many mods, even when uninstalled, leave behind files and database edits.

So, the problem is not in your files.
the problem is in yoru database.

the passwd column is there. Even though your previous screen shot did not show it, your SYSTEM knows it is there -- and it does not have a default value.  That's really the only problem.
Why did this start happening now when it was not happening before?  Because your host upgraded to a version of mySQL that requires it or turned on STRICT mode...   and the mod was sloppily coded and did not set a default value (since it was not required in previous versions of mySQL)

So, you have to find the passwd column in the smf_boards table.
Then you have to set a default value of NULL for that column
-poof- your issue will be solved...   but you have to find the column first. ;)
Сл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."

Arantor

That link contains no reference to the package...

Kindred

dunno what you're talking about, man....   :P

(yes, link fixed)
Сл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."

Omebolle

Think I got to the right place, Control Panel- PHPMyAdmin-smf-boards.. but cannot find anything about passwd

Kindred

so....  you are correct.
The picture does not show and passwd column.

However, the mod DOES add one...

$smcFunc['db_add_column']('{db_prefix}boards', array('name' => 'passwd', 'type' => 'varchar', 'size' => 64), array(), 'ignore');

and your error indicates that your system is seeing it.

My only suggestion is ---  are you certain that when you go into phpmyadmin, that you are viewing the correct database?
Сл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."

Omebolle

Only have one database as far as I know, only one comes up when I want to select which one to open

You're right, wrong file. One database, but the forum is in another section, I have it in a folder called test. So I needed the "test_boards" file and there it is (line 17), but how to change the value to NULL?

Sir Osis of Liver

If the mod is no longer installed, just click 'Drop', that will remove the column.  Or you can add null value by clicking 'Edit'.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Omebolle

will try, thanks
Edit; Worked like a charm, new board added without problems.

Thanks for the help people 8)

Advertisement: