1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Server Error

Discussion in 'Troubleshooting and Problems' started by New Joe, Jun 6, 2015.

  1. New Joe

    New Joe Active 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?
  2. Mike

    Mike XenForo Developer Staff Member

    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.
    New Joe likes this.
  3. New Joe

    New Joe Active Member

  4. New Joe

    New Joe Active Member

    Nope, still the same error unless i disable the above add-on
  5. Snog

    Snog Well-Known Member

    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.

    class Snog_CountryFlags_Model_Post extends XFCP_Snog_CountryFlags_Model_Post
       public function preparePostJoinOptions(array $fetchOptions)
         $userOptions = parent::preparePostJoinOptions($fetchOptions);
         $userOptions['selectFields'] .= ',
         $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...
      public function prepareThreadFetchOptions(array $fetchOptions)
         $userOptions = parent::prepareThreadFetchOptions($fetchOptions);
         $userOptions['selectFields'] .= ',
         $userOptions['joinTables'] .= '
             LEFT JOIN xf_user_privacy AS privacy ON
               (privacy.user_id = thread.user_id)';
         return $userOptions;
  6. New Joe

    New Joe Active Member

    Ok, I'll have to disable them all, then start on by one with yours first
    It was just strange that after disabling yours it was ok..
  7. Snog

    Snog Well-Known Member

    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.
  8. New Joe

    New Joe Active Member

    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
  9. Snog

    Snog Well-Known Member

    Taking this to a PC
  10. New Joe

    New Joe Active Member

    No probs...
  11. Snog

    Snog Well-Known Member

    It turns out that XF versions prior to 1.4.3 can't have the user privacy info added to the query when copying posts.

Share This Page