XF 2.0 MSQL Error

gforce

Active member
Team,

I really tried to do as much research as I could (2 days of forums, googling and etc). I went into phpadmin and tried to hunt this down, but cannot find it. I'm use to VB so the learning curb has been quite difficult. Would you have any idea on where to start?


XF\Db\Exception: MySQL query error [1364]: Field 'discord_options' doesn't have a default value in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 174
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 69
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 74
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 150
  5. XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1381
  6. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1113
  7. XF\Mvc\Entity\Entity->save() in src/XF/Mvc/FormAction.php at line 69
  8. XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 159
  9. XF\Mvc\FormAction->run() in src/XF/Admin/Controller/AbstractNode.php at line 110
  10. XF\Admin\Controller\AbstractNode->actionSave() in src/XF/Mvc/Dispatcher.php at line 249
  11. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  12. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  13. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1880
  14. XF\App->run() in src/XF.php at line 328
  15. XF::runApp() in admin.php at line 13
 
ya the guys is not responding. I just wondered if there was a generic way to find such a record in phpadmin offhand.

Open the addons install file (usually install.php) and look for the sql code creating that field, it will tell you the correct table.
 
Open the addons install file (usually install.php) and look for the sql code creating that field, it will tell you the correct table.

this is what i'm looking at (thanks, i would have never found this)

<?php

namespace EWR\Discord;

use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;

use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;

class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;

public function installStep1()
{
$this->schemaManager()->alterTable('xf_node', function(Alter $table)
{
$table->addColumn('discord_options', 'blob');
});

$this->schemaManager()->alterTable('xf_user_connected_account', function(Alter $table)
{
$table->addColumn('sync_date', 'int', 10);
});
}

public function installStep2()
{
$this->db()->insert('xf_connected_account_provider', [
'provider_id' => 'discord',
'provider_class' => 'EWR\Discord:Provider\Discord',
'display_order' => 100,
'options' => []
]);
}

public function uninstallStep1()
{
$this->schemaManager()->alterTable('xf_node', function(Alter $table)
{
$table->dropColumns('discord_options');
});

$this->schemaManager()->alterTable('xf_user_connected_account', function(Alter $table)
{
$table->dropColumns('sync_date');
});
}

public function uninstallStep2()
{
$this->db()->delete('xf_connected_account_provider', 'provider_id = ?', 'discord');
}
}
 
Yes, so the relevant part to your error is:

public function installStep1()
{
$this->schemaManager()->alterTable('xf_node', function(Alter $table)
{
$table->addColumn('discord_options', 'blob');

There is no default value set, so you need to set one manually (as its blob, this would be NULL).
 
Snip20180130_83.webp

Found it, deleted it and could build nodes again, was under xf_node, looking at the code (insight you gave helped). I just didn't know where to start! Many thanks! If you PM a paypal address, I wouldn't mind making a small donation.
 
Community support is free, though the offer is appreciated :)

You know how it is with free support at times; deal with Dell tech support and ya... thanks. I posted the solution under the addon incase anyone else has the issue. It was just hard to start because it tells you about a mysql error point at an xenforo file at line 212 and i'm like; where the heck is the table hiding lol.
 
Any help why am i getting this while installing any addon

XF\Db\Exception: MySQL statement prepare error [1932]: Table 'entmnt_db.xf_template_phrase' doesn't exist in engine in src/XF/Db/AbstractStatement.php at line 212
 
Seems like you are missing a table(s) one named xf_template_phrase for sure. The database may be corrupt.

This post should help you get the table back,

But you need to find out why this is happening. Do you have XFMG installed?
 
Seems like you are missing a table(s) one named xf_template_phrase for sure. The database may be corrupt.

This post should help you get the table back,

But you need to find out why this is happening. Do you have XFMG installed?

No. How will XFMG help in this?
 
Seems like you are missing a table(s) one named xf_template_phrase for sure. The database may be corrupt.

This post should help you get the table back,

But you need to find out why this is happening. Do you have XFMG installed?

Should I follow the one suggested by @Mike in above post?
 
Top Bottom