Mark Posts as Best Answer [Deleted]

Got this error when running "Rebuild Thread Information"

Code:
An exception occurred: The existing data required by the data writer could not be found. in /library/XenForo/DataWriter.php on line 1345

XenForo_DataWriter->_haveErrorsPreventSave() in XenForo/DataWriter.php at line 1387
XenForo_DataWriter->save() in DigitalPointSpy/DataWriter/DiscussionMessage/Post.php at line 7
DigitalPointSpy_DataWriter_DiscussionMessage_Post->save() in BestAnswer/Model/BestAnswer.php at line 201
BestAnswer_Model_BestAnswer->recalculateBestAnswerForThread() in BestAnswer/DataWriter/Discussion/Thread.php at line 36
BestAnswer_DataWriter_Discussion_Thread->rebuildDiscussionCounters() in XenForo/Deferred/Thread.php at line 44
XenForo_Deferred_Thread->execute() in XenForo/Model/Deferred.php at line 256
XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 390
XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 335
XenForo_Model_Deferred->run() in XenForo/ViewRenderer/Abstract.php at line 352
XenForo_ViewRenderer_Abstract::hasManualDeferredToRun() in XenForo/ViewRenderer/HtmlAdmin.php at line 130
XenForo_ViewRenderer_HtmlAdmin->renderContainer() in XenForo/FrontController.php at line 618
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /admin.php at line 13
Code:
Error Info
XenForo_Exception: The existing data required by the data writer could not be found. - library/XenForo/DataWriter.php:1345
Generated By: Draft, 1 minute ago
Stack Trace
#0 /library/XenForo/DataWriter.php(1387): XenForo_DataWriter->_haveErrorsPreventSave()
#1 /library/DigitalPointSpy/DataWriter/DiscussionMessage/Post.php(7): XenForo_DataWriter->save()
#2 /library/BestAnswer/Model/BestAnswer.php(201): DigitalPointSpy_DataWriter_DiscussionMessage_Post->save()
#3 /library/BestAnswer/DataWriter/Discussion/Thread.php(36): BestAnswer_Model_BestAnswer->recalculateBestAnswerForThread(Array)
#4 /library/XenForo/Deferred/Thread.php(44): BestAnswer_DataWriter_Discussion_Thread->rebuildDiscussionCounters()
#5 /library/XenForo/Model/Deferred.php(256): XenForo_Deferred_Thread->execute(Array, Array, 6.9463782310486, '')
#6 /library/XenForo/Model/Deferred.php(390): XenForo_Model_Deferred->runDeferred(Array, 6.9463782310486, '', false)
#7 /library/XenForo/Model/Deferred.php(335): XenForo_Model_Deferred->_runInternal(Array, 6.9463791847229, '', false)
#8 /library/XenForo/ViewRenderer/Abstract.php(352): XenForo_Model_Deferred->run(true, 6.9463791847229)
#9 /library/XenForo/ViewRenderer/HtmlAdmin.php(130): XenForo_ViewRenderer_Abstract::hasManualDeferredToRun(true)
#10 /library/XenForo/FrontController.php(618): XenForo_ViewRenderer_HtmlAdmin->renderContainer(Object(XenForo_Template_Admin), Array)
#11 /library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_Error), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#12 /admin.php(13): XenForo_FrontController->run()
#13 {main}
Request State
array(3) {
  ["url"] => string(53) "https://www.phcorner.net/admin.php?tools/run-deferred"
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["redirect"] => string(58) "https://www.phcorner.net/admin.php?tools/rebuild&success=1"
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
 
Got this error when running "Rebuild Thread Information"

Code:
An exception occurred: The existing data required by the data writer could not be found. in /library/XenForo/DataWriter.php on line 1345

XenForo_DataWriter->_haveErrorsPreventSave() in XenForo/DataWriter.php at line 1387
XenForo_DataWriter->save() in DigitalPointSpy/DataWriter/DiscussionMessage/Post.php at line 7
DigitalPointSpy_DataWriter_DiscussionMessage_Post->save() in BestAnswer/Model/BestAnswer.php at line 201
BestAnswer_Model_BestAnswer->recalculateBestAnswerForThread() in BestAnswer/DataWriter/Discussion/Thread.php at line 36
BestAnswer_DataWriter_Discussion_Thread->rebuildDiscussionCounters() in XenForo/Deferred/Thread.php at line 44
XenForo_Deferred_Thread->execute() in XenForo/Model/Deferred.php at line 256
XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 390
XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 335
XenForo_Model_Deferred->run() in XenForo/ViewRenderer/Abstract.php at line 352
XenForo_ViewRenderer_Abstract::hasManualDeferredToRun() in XenForo/ViewRenderer/HtmlAdmin.php at line 130
XenForo_ViewRenderer_HtmlAdmin->renderContainer() in XenForo/FrontController.php at line 618
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /admin.php at line 13
Code:
Error Info
XenForo_Exception: The existing data required by the data writer could not be found. - library/XenForo/DataWriter.php:1345
Generated By: Draft, 1 minute ago
Stack Trace
#0 /library/XenForo/DataWriter.php(1387): XenForo_DataWriter->_haveErrorsPreventSave()
#1 /library/DigitalPointSpy/DataWriter/DiscussionMessage/Post.php(7): XenForo_DataWriter->save()
#2 /library/BestAnswer/Model/BestAnswer.php(201): DigitalPointSpy_DataWriter_DiscussionMessage_Post->save()
#3 /library/BestAnswer/DataWriter/Discussion/Thread.php(36): BestAnswer_Model_BestAnswer->recalculateBestAnswerForThread(Array)
#4 /library/XenForo/Deferred/Thread.php(44): BestAnswer_DataWriter_Discussion_Thread->rebuildDiscussionCounters()
#5 /library/XenForo/Model/Deferred.php(256): XenForo_Deferred_Thread->execute(Array, Array, 6.9463782310486, '')
#6 /library/XenForo/Model/Deferred.php(390): XenForo_Model_Deferred->runDeferred(Array, 6.9463782310486, '', false)
#7 /library/XenForo/Model/Deferred.php(335): XenForo_Model_Deferred->_runInternal(Array, 6.9463791847229, '', false)
#8 /library/XenForo/ViewRenderer/Abstract.php(352): XenForo_Model_Deferred->run(true, 6.9463791847229)
#9 /library/XenForo/ViewRenderer/HtmlAdmin.php(130): XenForo_ViewRenderer_Abstract::hasManualDeferredToRun(true)
#10 /library/XenForo/FrontController.php(618): XenForo_ViewRenderer_HtmlAdmin->renderContainer(Object(XenForo_Template_Admin), Array)
#11 /library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_Error), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#12 /admin.php(13): XenForo_FrontController->run()
#13 {main}
Request State
array(3) {
  ["url"] => string(53) "https://www.phcorner.net/admin.php?tools/run-deferred"
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["redirect"] => string(58) "https://www.phcorner.net/admin.php?tools/rebuild&success=1"
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
I'll release a corrected version soon.

In the meanwhile, you can open library/BestAnswer/Model/BestAnswer.php, and find the following line (#178):
Code:
LEFT JOIN xf_post AS post

Then replace it with the following line:
Code:
INNER JOIN xf_post AS post
 
  • Like
Reactions: rdn
I'll release a corrected version soon.

In the meanwhile, you can open library/BestAnswer/Model/BestAnswer.php, and find the following line (#178):
Code:
LEFT JOIN xf_post AS post

Then replace it with the following line:
Code:
INNER JOIN xf_post AS post
Thanks!
 
Another bug? I encounter on this thread.
Alternative answer on post #1?
upload_2014-11-3_13-40-0.webp

How come it happens?
And the link will give 404 page.
 
Badly needed feature request:
- Ability for the staff/moderators to un-mark post as best answer.

Thanks!
 
Style Properties: Mark as Best Answer > Miscellaneous
Is this valid css?
Code:
-webkit-
    -moz-
    -khtml-
-webkit-
    -moz-
    -khtml-
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;

I mean this on top:
-moz-
-khtml-
-webkit-
-moz-
-khtml-
 
Best Answer Count is not working on message_user_info (bestAnswerMessageUserInfo) template modification.
Now I changed it like this:
upload_2014-11-8_5-0-3.webp

It works perfectly now, I hope next version you will change it with that code.
 
Any ideas on how to make the Best Answer button more prominent? I don't think it stands out enough. Making it a different colour might work, but how about relocating it to a more prominent place?
 
How do I bet the old style back. Where the whole "best answer" post sits below the question.

I can only see 2 option, one where a bar is displayed under the question and the other puts the answer in the original post.

Thanks
 
I think, plugin have a alert bug!

We have alert problem on marked as best answer selected threads.

For example; if you select you my post as best answer in thread, then i take a alert about that on my notifications it is okay but then, i continue to take alerts on this thread while someone posted anything ( not mark as best answer) So, i take too many alert while members post a message this thread after my posts selected as best answer.

Can you please check it ? @Lior.
 
Last edited:
1) I would like to remove "Best Answers tab in the user profile". Too many tabs already. When I uncheck the tab template for Best Answers, it corrupts all the tabs on Profile Page.
2) Would like to move thread display options to top.

Many thanks
 
Last edited:
@Lior
1) I would like to remove "Best Answers tab in the user profile". Too many tabs already. When I uncheck the tab template for Best Answers, it corrupts all the tabs on Profile Page.

Many thanks
 
I tried to install v 1.5.1 of the addon "Mark Posts as Best Answer" today together with XF 1.4.2.

The installation failed after about ~3 seconds displaying this:

Code:
Server Error
Mysqli statement execute error : Got error 64 'Temp file write failure' from InnoDB

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in BestAnswer/Installer.php at line 48
BestAnswer_Installer::install()
call_user_func() in XenForo/Model/AddOn.php at line 215
XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 187
XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /var/www/site.se/forum/admin.php at line 13

I noticed that members couldn't create new threads afterwards and since I had no option of uninstalling the addon I decided to install version 1.4.1. That worked, but after uninstalling it via the addon manager, the problem with creating new threads persists.

The error which reads "Field 'alternative_best_answers' doesn't have a default value" looks like this:

Code:
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Field 'alternative_best_answers' doesn't have a default value - library/Zend/Db/Statement/Mysqli.php:214
Generated By: canfield, 1 minut sedan
Stack Trace
#0 /var/www/site.se/forum/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/sitese/forum/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/site.se/forum/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /var/www/site.se/forum/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xf_thread', Array)
#4 /var/www/site.se/forum/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /var/www/site.se/forum/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /var/www/site.se/forum/library/XenForo/ControllerPublic/Forum.php(728): XenForo_DataWriter->save()
#7 /var/www/site.se/forum/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Forum->actionAddThread()
#8 /var/www/site.se/forum/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /var/www/site.se/forum/index.php(13): XenForo_FrontController->run()
#10 {main}

Can anyone help me fix this?
 
Last edited:
I tried to install v 1.5.1 of the addon "Mark Posts as Best Answer" today together with XF 1.4.2.

The installation failed after about ~3 seconds displaying this:

Code:
Server Error
Mysqli statement execute error : Got error 64 'Temp file write failure' from InnoDB

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in BestAnswer/Installer.php at line 48
BestAnswer_Installer::install()
call_user_func() in XenForo/Model/AddOn.php at line 215
XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 187
XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /var/www/site.se/forum/admin.php at line 13

I noticed that members couldn't create new threads afterwards and since I had no option of uninstalling the addon I decided to install version 1.4.1. That worked, but after uninstalling it via the addon manager, the problem with creating new threads persists.

The error which reads "Field 'alternative_best_answers' doesn't have a default value" looks like this:

Code:
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Field 'alternative_best_answers' doesn't have a default value - library/Zend/Db/Statement/Mysqli.php:214
Generated By: canfield, 1 minut sedan
Stack Trace
#0 /var/www/site.se/forum/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/sitese/forum/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/site.se/forum/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /var/www/site.se/forum/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xf_thread', Array)
#4 /var/www/site.se/forum/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
#5 /var/www/site.se/forum/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#6 /var/www/site.se/forum/library/XenForo/ControllerPublic/Forum.php(728): XenForo_DataWriter->save()
#7 /var/www/site.se/forum/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Forum->actionAddThread()
#8 /var/www/site.se/forum/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /var/www/site.se/forum/index.php(13): XenForo_FrontController->run()
#10 {main}

Can anyone help me fix this?
This is now sorted. The error during installation was caused by the ramdisk not being large enough to accommodate the temporary table created during the installation of the addon (734mb)
 
I think, plugin have a alert bug!

We have alert problem on marked as best answer selected threads.

For example; if you select you my post as best answer in thread, then i take a alert about that on my notifications it is okay but then, i continue to take alerts on this thread while someone posted anything ( not mark as best answer) So, i take too many alert while members post a message this thread after my posts selected as best answer.

Can you please check it ? @Lior.
Anyone have same problem ? My members are disturbed with this problem.
We bought this plugin with money but support not same! @Lior.
 
The "Best Answer" button currently displays on the LEFT under each post. Lots of our members are overlooking the button cause they're so accustomed to clicking "Like" that they never notice or remember the "Best" button is overe there. Would it be possible to add an admin option that places the "Best Answer" button directly to the left of the "Like" button, aligned on the bottom right of the post with the other primary buttons?

I may get someone to do this myself... but I feel like it's something other people here could use/appreciate.
 
@Lior. @RoldanLT
Just asking, have this been implemented ?
v
v
v
@Lior.
Could you please add maximum times a member of particular usergroup to vote in a day ? (permission-based)

I think this is crucial for preventing "spam-voting" for this system.

Can't imagine if someone pursuing "best answer" trophy performs sock-doll-show with ridiculuous QA - asked and answered by himself (with different ids) :D

thx :)
 
Top Bottom