XF 1.4 Server Error

New Joe

Well-known member
I am trying to copy a post from a Thread and move it to an existing URL of another Thread but I keep getting this below Server Error:

Server Error
Mysqli prepare error: Unknown column 'allow_view_profile' in 'field list'

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  5. Zend_Db_Adapter_Abstract->insert() in XenForo/Model/Post.php at line 1633
  6. XenForo_Model_Post->_copyPost() in XenForo/Model/Post.php at line 1471
  7. XenForo_Model_Post->_moveOrCopyPosts() in XenForo/Model/Post.php at line 1377
  8. XenForo_Model_Post->copyPosts() in XenForo/Model/InlineMod/Post.php at line 475
  9. XenForo_Model_InlineMod_Post->_moveOrCopyPosts() in XenForo/Model/InlineMod/Post.php at line 419
  10. XenForo_Model_InlineMod_Post->copyPosts() in XenForo/ControllerPublic/InlineMod/Post.php at line 231
  11. XenForo_ControllerPublic_InlineMod_Post->_moveOrCopyPostsAction() in XenForo/ControllerPublic/InlineMod/Post.php at line 155
  12. XenForo_ControllerPublic_InlineMod_Post->actionCopy() in XenForo/FrontController.php at line 347
  13. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  14. XenForo_FrontController->run() in /home/xxxx/public_html/mysite.com/index.php at line 13

Any ideas?
Thanks
 
This is likely caused by an add-on manipulating an earlier query and adding unexpected data. You'll need to disable add-ons one by one to identify it and then contact the author.
 
I can't duplicate the problem.

Have you tried leaving the country flags add-on enabled and disabling all other add-ons?

The county flags add-on does not access the 'allow_view_profile' field.

It does join the 'xf_user_privacy' table to the post query, but it does it in a fashion that keeps the parent joins intact.

Code:
class Snog_CountryFlags_Model_Post extends XFCP_Snog_CountryFlags_Model_Post
{
   public function preparePostJoinOptions(array $fetchOptions)
   {
     $userOptions = parent::preparePostJoinOptions($fetchOptions);
     $userOptions['selectFields'] .= ',
         user_privacy.*';
     $userOptions['joinTables'] .= '
           LEFT JOIN xf_user_privacy AS user_privacy ON
             (user_privacy.user_id = post.user_id)';
     return $userOptions;
   }
}

It does the same thing for threads...
Code:
  public function prepareThreadFetchOptions(array $fetchOptions)
   {
     $userOptions = parent::prepareThreadFetchOptions($fetchOptions);
     $userOptions['selectFields'] .= ',
         privacy.snog_flag_view';
     $userOptions['joinTables'] .= '
         LEFT JOIN xf_user_privacy AS privacy ON
           (privacy.user_id = thread.user_id)';
     return $userOptions;
   }
 
Leave mine enabled and disable the other ones.

There is another add-on that is using the privacy field that isn't keeping the parent query.
 
Ok so I disabled all add-ons, then turn back on just the flag add-on
It did the exact same error
I then disabled the flag add-on, all was ok no error.
I enabled all other add-ons one by one, no errors
The only error happens when enabling the flag add-on, even when it's just the one alone.

No idea why it's doing that with all other add-ons disabled apart from the flag add-on
 
Back
Top Bottom