• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • SQL error when trying to send PM

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: SQL error when trying to send PM

    • Issue Tools
      • View Changes
    1. issueid=6107 October 16, 2020 12:17 PM
      madolfsson madolfsson is offline
      New Member
      SQL error when trying to send PM

      I get the below DB error when trying to view the PM. Fixed it for now by adding the column to the table.


      Database error in vBulletin 4.2.5:

      Invalid SQL:
      (
      SELECT
      COUNT(*) AS count, SUM(fd.filesize) AS sum
      FROM phenom_attachment AS a
      INNER JOIN phenom_filedata AS fd ON (a.filedataid = fd.filedataid)
      LEFT JOIN phenom_attachmenttype AS at ON (at.extension = fd.extension)
      INNER JOIN phenom_album AS album ON (album.albumid = a.contentid)
      LEFT JOIN phenom_profileblockprivacy AS pbp ON (pbp.userid = a.userid AND pbp.blockid = 'albums')
      LEFT JOIN phenom_user AS user ON (a.userid = user.userid)
      WHERE
      a.contenttypeid = 8 AND
      (
      (
      a.contentid = 0
      AND
      a.userid = 403
      )
      OR
      (
      a.contentid <> 0
      )
      )
      AND a.userid = 403
      ) UNION ALL (
      SELECT
      COUNT(*) AS count, SUM(fd.filesize) AS sum
      FROM phenom_attachment AS a
      INNER JOIN phenom_filedata AS fd ON (a.filedataid = fd.filedataid)
      LEFT JOIN phenom_attachmenttype AS at ON (at.extension = fd.extension)
      LEFT JOIN phenom_post AS post ON (post.postid = a.contentid)
      LEFT JOIN phenom_thread AS thread ON (post.threadid = thread.threadid)
      LEFT JOIN phenom_user AS user ON (a.userid = user.userid)
      WHERE
      a.contenttypeid = 1 AND
      (
      (
      a.contentid = 0
      AND
      a.userid = 403
      )
      OR
      (
      thread.forumid IN (0, 1, 6, 71, 70, 43, 30, 45, 8, 4, 74, 55, 72, 40, 65, 67, 54, 58, 73, 2, 24) AND (
      thread.forumid IN (0, 1, 6, 71, 70, 43, 30, 45, 8, 4, 74, 55, 72, 40, 65, 67, 54, 58, 73, 2, 24)
      OR
      thread.postuserid = 403
      ) AND (
      a.state <> 'moderation'
      OR
      a.userid = 403
      OR
      thread.forumid IN (0, 1, 6, 71, 70, 43, 30, 45, 8, 4, 74, 55, 72, 40, 65, 67, 54, 58, 73, 2, 24)
      ) AND (
      (
      post.visible = 1
      AND
      thread.visible = 1
      )
      OR
      (
      thread.forumid IN (0, 1, 6, 71, 70, 43, 30, 45, 8, 4, 74, 55, 72, 40, 65, 67, 54, 58, 73, 2, 24)
      )
      OR
      (
      thread.forumid IN (0, 1, 6, 71, 70, 43, 30, 45, 8, 4, 74, 55, 72, 40, 65, 67, 54, 58, 73, 2, 24)
      AND
      post.visible = 2
      AND
      thread.visible = 2
      )
      )
      )
      )
      AND a.userid = 403
      ) UNION ALL (
      SELECT
      COUNT(*) AS count, SUM(fd.filesize) AS sum
      FROM phenom_attachment AS a
      INNER JOIN phenom_filedata AS fd ON (a.filedataid = fd.filedataid)
      LEFT JOIN phenom_attachmenttype AS at ON (at.extension = fd.extension)
      INNER JOIN phenom_socialgroupmember AS sgm ON (sgm.userid = a.userid AND sgm.groupid = a.contentid AND sgm.type = 'member')
      LEFT JOIN phenom_socialgroupmember AS bm ON (bm.userid = 403 AND bm.groupid = a.contentid)
      INNER JOIN phenom_socialgroup AS sg ON (sg.groupid = a.contentid)
      LEFT JOIN phenom_user AS user ON (a.userid = user.userid)
      WHERE
      a.contenttypeid = 7 AND
      (
      (
      a.contentid = 0
      AND
      a.userid = 403
      )
      OR
      (
      sg.options & 8
      )
      )
      AND a.userid = 403
      ) UNION ALL (
      SELECT
      COUNT(*) AS count, SUM(fd.filesize) AS sum
      FROM phenom_attachment AS a
      INNER JOIN phenom_filedata AS fd ON (a.filedataid = fd.filedataid)
      LEFT JOIN phenom_attachmenttype AS at ON (at.extension = fd.extension)
      LEFT JOIN phenom_cms_node AS node ON (a.contentid = node.nodeid)
      LEFT JOIN phenom_user AS user ON (user.userid = node.userid)
      WHERE
      a.contenttypeid = 27 AND
      (
      (
      a.contentid = 0
      AND
      a.userid = 403
      )
      OR
      (
      a.contentid <> 0
      )
      )
      AND a.userid = 403
      ) UNION ALL (
      SELECT
      COUNT(*) AS count, SUM(fd.filesize) AS sum
      FROM phenom_attachment AS a
      INNER JOIN phenom_filedata AS fd ON (a.filedataid = fd.filedataid)
      LEFT JOIN phenom_attachmenttype AS at ON (at.extension = fd.extension)
      LEFT JOIN phenom_vw_comment AS comment ON (comment.commentid = a.contentid)
      LEFT JOIN phenom_vw_discussion AS talk ON (comment.discussionid = talk.discussionid)
      LEFT JOIN phenom_vw_page AS page ON (talk.pageid = page.pageid)
      WHERE
      a.contenttypeid = 34 AND
      (
      (
      a.contentid = 0
      AND
      a.userid = 403
      )
      OR
      (
      page.areaid IN (0, 2, 13) AND (
      a.state <> 'moderation' OR
      a.userid = 403 OR
      page.areaid IN (0)
      ) AND (
      (
      comment.visible = 1 AND
      talk.visible = 1 AND
      page.visible = 1
      ) OR
      (
      page.areaid IN (0)
      )
      )
      )
      )
      AND a.userid = 403
      );

      MySQL Error : Unknown column 'talk.pageid' in 'on clause'
      Error Number : 1054
      Request Date : Friday, October 16th 2020 @ 12:07:36 PM
      Error Date : Friday, October 16th 2020 @ 12:07:36 PM
      Script : http://www.phenompilots.org/private.php?do=newpm&u=1860
      Referrer : https://www.phenompilots.org/threads...s-Bugs?p=55797
      IP Address : 108.162.212.104
      Username : Marcus Adolfsson
      Classname : vB_Database_MySQLi
      MySQL Version : 8.0.21-0ubuntu0.20.04.4
      Server : 10.128.0.3
      User Agent :
    Issue Details
    Issue Number 6107
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category General
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.0
    Fixed Version 4.1.1
    Milestone (none)
    Software DependencyvBulletin 4.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. October 16, 2020 5:15 PM
      pegasus pegasus is offline
      VaultWiki Team
      This occurs when viewing a list of all of a user's attachments in vBulletin 4, if using VaultWiki that was freshly installed at 4.1.0 RC 1 or higher. I am not sure why this is affecting private messages for you, since private messages do not use attachments in vBulletin 4. However, I could see it affecting the ability to access vBulletin 4's attachment popup for other kinds of posts and messages.

      In packages/vw/attach/vwcomment.php, find:
      Code:
      			"LEFT JOIN " . TABLE_PREFIX . "vw_discussion AS talk ON (comment.discussionid = talk.discussionid)",
      			"LEFT JOIN " . TABLE_PREFIX . "vw_page AS page ON (talk.pageid = page.pageid)",
      		);
      Replace with:
      Code:
      			"LEFT JOIN " . TABLE_PREFIX . "vw_discussion AS talk ON (comment.discussionid = talk.discussionid)",
      		);
      
      		if (vw_Hard_Core::model('Version')->installed('4.1.0 RC 1'))
      		{
      			$ontalk = "talk.contentid = page.pageid AND talk.contenttypeid = " . vw_Hard_Core::model('Node')->id('Page');
      		}
      		else
      		{
      			$ontalk = "talk.pageid = page.pageid";
      		}
      
      		$joinsql[] = "LEFT JOIN " . TABLE_PREFIX . "vw_page AS page ON ($ontalk)";
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 2:39 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.