Lỗi MySQL , cột purchase_type

Binvnhehe999

Corporal
Tham gia
05/08/2023
Bài viết
197
Được Like
22
Trước mình có cài đặt addon

[DBTech] DragonByte Shop 6.6.1​

và gập lỗi ở Conversation
Chi tiết lỗi
Mã:
Server error log
XF\Db\Exception: MySQL query error [1364]: Field 'purchase_type' doesn't have a default value src/XF/Db/AbstractStatement.php:230
Generated by: Mèo Hầu Nữ Mar 31, 2024 at 2:37 AM
Stack trace
INSERT  INTO `xf_conversation_master` (`user_id`, `username`, `open_invite`, `conversation_open`, `title`, `start_date`, `last_message_date`, `last_message_user_id`, `last_message_username`, `conversation_id`, `reply_count`, `recipient_count`, `first_message_id`, `last_message_id`, `recipients`, `first_react_users`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1364, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(78): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1364, 'HY000')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(219): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1526): XF\Db\AbstractAdapter->insert('xf_conversation...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1258): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Service/Conversation/Creator.php(227): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\Conversation\Creator->_save()
#8 src/XF/Pub/Controller/Conversation.php(328): XF\Service\Conversation\Creator->save()
#9 src/addons/OzzModz/AdultContent/XF/Pub/Controller/Conversation.php(71): XF\Pub\Controller\Conversation->actionAdd()
#10 src/XF/Mvc/Dispatcher.php(352): OzzModz\AdultContent\XF\Pub\Controller\Conversation->actionAdd(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Conversation', 'Add', Object(XF\Mvc\RouteMatch), Object(SV\MultiPrefix\XF\Pub\Controller\Conversation), NULL)
#12 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\MultiPrefix\XF\Pub\Controller\Conversation), NULL)
#13 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#15 src/XF.php(524): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(18) "/conversations/add"
  ["referrer"] => string(46) "https://mcvncommunity.pro.vn/conversations/add"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(10) {
    ["_xfToken"] => string(8) "********"
    ["tokens_select"] => string(7) "example"
    ["recipients"] => string(7) "example"
    ["title"] => string(13) "Example title"
    ["message_html"] => string(14) "<p>Example</p>"
    ["attachment_hash"] => string(32) "9c6e85b9bfab78488a0aeddc9f4bfe2a"
    ["attachment_hash_combined"] => string(86) "{"type":"conversation_message","context":[],"hash":"9c6e85b9bfab78488a0aeddc9f4bfe2a"}"
    ["_xfRequestUri"] => string(18) "/conversations/add"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
(đã xóa addon lỗi)

Mình đã thử gỡ cài đặt/cài lại addon/... nhưng lỗi vẫn còn ạ. Mong mọi người hỗ trợ mình để sửa ạ

Trân trọng
 

Binvnhehe999

Corporal
Tham gia
05/08/2023
Bài viết
197
Được Like
22
Đã tự sửa chữa

Cách sửa
Gửi những dòng dưới đây vào console

ALTER TABLE xf_conversation_master MODIFY COLUMN purchase_type VARCHAR(255) NOT NULL DEFAULT '';

ALTER TABLE xf_conversation_master MODIFY COLUMN purchase_type VARCHAR(255) DEFAULT NULL;
 
  • Like
Reactions: PVS

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom