Board Rules

error when activating: "General Error SQL ERROR [ mysql4 ]" - Board Rules

error when activating: "General Error SQL ERROR [ mysql4 ]"

by craig.constantine » Sun May 28, 2017 4:38 pm

I d/l'd from here (as opposed to the master from Git repo), unzip, upload and went into ACP. Customize > Manage Extensions... I see version 2.1.0 (as i expect)
But when I hit Enable, and confirm... I get:

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Truncated incorrect DOUBLE value: 'en_us' [1292]

SQL

UPDATE phpbb_boardrules SET rule_language = 'en' WHERE rule_language = 1

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysql.php
LINE: 191
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysql->sql_query()

FILE: [ROOT]/ext/phpbb/boardrules/migrations/helper.php
LINE: 70
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/ext/phpbb/boardrules/migrations/v20x/m15_update_lang_schema.php
LINE: 85
CALL: phpbb\boardrules\migrations\helper->change_rule_language()

FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\boardrules\migrations\v20x\m15_update_lang_schema->change_rule_language()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 711
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 658
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 436
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 351
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/ext/phpbb/boardrules/ext.php
LINE: 69
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 185
CALL: phpbb\boardrules\ext->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 197
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
User avatar
craig.constantine
Registered User
Posts: 17
Joined: Sat May 27, 2017 1:47 am

Re: error when activating: "General Error SQL ERROR [ mysql4

by rxu » Sun May 28, 2017 4:58 pm

craig.constantin, could you try changing the line 69 of boardrules/migrations/helper.php

Code: Select all

WHERE $old_column = " . (int) $row['lang_id'];
to

Code: Select all

WHERE $old_column = " . (string) $row['lang_id'];
and try enabling the extension again?
rxu
Extensions Development Team
Posts: 2932
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: error when activating: "General Error SQL ERROR [ mysql4

by craig.constantine » Sun May 28, 2017 5:05 pm

done. still get an error. I think this is identical...

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Truncated incorrect DOUBLE value: 'en_us' [1292]

SQL

UPDATE phpbb_boardrules SET rule_language = 'en' WHERE rule_language = 1

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysql.php
LINE: 191
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysql->sql_query()

FILE: [ROOT]/ext/phpbb/boardrules/migrations/helper.php
LINE: 70
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/ext/phpbb/boardrules/migrations/v20x/m15_update_lang_schema.php
LINE: 85
CALL: phpbb\boardrules\migrations\helper->change_rule_language()

FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\boardrules\migrations\v20x\m15_update_lang_schema->change_rule_language()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 711
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 658
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 436
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 351
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/ext/phpbb/boardrules/ext.php
LINE: 69
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 185
CALL: phpbb\boardrules\ext->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 197
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
User avatar
craig.constantine
Registered User
Posts: 17
Joined: Sat May 27, 2017 1:47 am

Re: error when activating: "General Error SQL ERROR [ mysql4

by rxu » Sun May 28, 2017 5:08 pm

Well, let's correct the line like that:

Code: Select all

WHERE $old_column = '" . (string) $row['lang_id'] . "'";
rxu
Extensions Development Team
Posts: 2932
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: error when activating: "General Error SQL ERROR [ mysql4

by craig.constantine » Sun May 28, 2017 5:12 pm

THAT fixes it!

I've got enabled. Is that code only used when it first gets installed? ...or should I worry about it breaking if I update this odule/plugin code?
User avatar
craig.constantine
Registered User
Posts: 17
Joined: Sat May 27, 2017 1:47 am

Re: error when activating: "General Error SQL ERROR [ mysql4

by rxu » Sun May 28, 2017 5:21 pm

It shouldn't affect your further updates of the extension as the problematic migration is already installed.
This can affect fresh installs or updates to the version 2.1.0 though.
rxu
Extensions Development Team
Posts: 2932
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: error when activating: "General Error SQL ERROR [ mysql4

by mykee » Thu Jun 01, 2017 11:59 am

Great! This fix working now on my board too!
mykee
Registered User
Posts: 271
Joined: Thu Jun 07, 2007 9:46 pm
Contact: