• 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
    • PHP Fatal Error prevents creating new pages

    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: PHP Fatal Error prevents creating new pages

    • Issue Tools
      • View Changes
    1. issueid=3179 July 8, 2013 10:03 PM
      rizwank rizwank is offline
      New Member
      PHP Fatal Error prevents creating new pages

      Code:
      [Mon Jul 08 05:37:07 2013] [error] [client  xxxx] PHP Fatal error:  Call to a member function setFetchMode() on a non-object in /var/www/html/forum/vault/core/controller/db/xf.php on line 133
      Code:
      xxxx - - [08/Jul/2013:05:37:01 -0700] "POST /wiki_ajax.php?c=create HTTP/1.1" 200 97 "http://mysiteurl/wiki_tools.php?do=integrate&action=edit&nodetypeid=21&nodeid=3625" "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"
      xxxx - - [08/Jul/2013:05:37:07 -0700] "GET /wiki_tools.php?do=integrate&action=edit&nodetypeid=21&nodeid=3625 HTTP/1.1" 200 138 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36"
    Issue Details
    Issue Number 3179
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Editing Pages
    Status Fixed
    Priority 1 - Security / Login / Data Loss
    Affected Version 4.0.0 Beta 2
    Fixed Version 4.0.0 Beta 3
    Milestone VaultWiki 4 Beta X
    Software DependencyAny
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)


    Page 2 of 3 FirstFirst Previous 123 Next LastLast


    1. July 11, 2013 1:42 AM
      pegasus pegasus is offline
      VaultWiki Team
      Place the print_debug_backtrace snippet above all lines with setFetchMode in that file, and revisit wiki_css.php. I really need the backtrace info in order to diagnose the problem.
      Reply Reply  
    2. July 11, 2013 2:08 AM
      rizwank rizwank is offline
      New Member
      Code:
      [Wed Jul 10 23:06:32 2013] [error] [client 23.20.162.103] PHP Fatal error:  Call to undefined function print_debug_backtrace() in /var/www/html/forum/vault/core/controller/db/xf.php on line 139
      [Wed Jul 10 23:06:32 2013] [error] [client 23.20.162.103] PHP Fatal error:  Call to undefined function print_debug_backtrace() in /var/www/html/forum/vault/core/controller/db/xf.php on line 139
      [Wed Jul 10 23:06:33 2013] [error] [client 23.20.162.103] PHP Fatal error:  Call to undefined function print_debug_backtrace() in /var/www/html/forum/vault/core/controller/db/xf.php on line 139
      Reply Reply  
    3. July 11, 2013 2:11 AM
      pegasus pegasus is offline
      VaultWiki Team
      Sorry, my mistake. The correct function call is "debug_print_backtrace". i.e. snippet:
      Code:
      		if (!is_object($this->instance))
      		{
      			debug_print_backtrace();
      		}
      "debug" and "print" should be reversed as shown above.
      Reply Reply  
    4. July 11, 2013 2:19 AM
      rizwank rizwank is offline
      New Member
      Maybe you meant debug_print_backtrace?

      Got it. One of the challenges is that that css load stays in cache, so i have to keep modifying the filename during edits.

      trace contains confidental data so emailed to you.

      btw just started seeing
      Code:
      [Wed Jul 10 23:15:25 2013] [error] [client 69.123.18.124] PHP Fatal error:  Class 'vw_XenForo_Controller' not found in /var/www/html/forum/vault/core/view/ui/proxy/xf.php on line 140
      Reply Reply  
    5. July 11, 2013 3:23 AM
      pegasus pegasus is offline
      VaultWiki Team
      I was unable to duplicate the problem using the information learned by the traces you provided. I see that your first test site is also running Beta 2 and is not encountering the issue, which leads me to believe there is a configuration mishap afoot.

      I have added another service to your members area. Please fill it out and I'll have a look. Unfortunately I've exhausted everything we can try without starting to significantly modify VaultWiki's files to see where the problem originates.
      Reply Reply  
    6. July 11, 2013 1:16 PM
      rizwank rizwank is offline
      New Member
      I don't think the first test site ever got to the point where we could post pages... I'll checkout hte services; and we can try out Beta 3 when the time comes.
      Reply Reply  
    7. July 11, 2013 10:38 PM
      rizwank rizwank is offline
      New Member
      Or I can uninstall and do a fresh reinstall. Can't wait until we can give this another production spin. =)
      Reply Reply  
    8. July 11, 2013 10:42 PM
      rizwank rizwank is offline
      New Member
      BTW I disabled all plugins, still had the error.
      Reply Reply  
    9. July 12, 2013 9:18 PM
      pegasus pegasus is offline
      VaultWiki Team
      In vault/core/controller/db/xf.php, find:
      Code:
      			else
      			{
      				$dir = vw_Hard_Core::get_dir('deps');
      Replace with:
      Code:
      			if (!$this->instance)
      			{
      				$dir = vw_Hard_Core::get_dir('deps');
      Let me know if it makes a difference.
      Reply Reply  
    10. July 12, 2013 9:54 PM
      rizwank rizwank is offline
      New Member
      Still an error, same
      Code:
      [Fri Jul 12 18:42:30 2013] [error] [client 23.23.48.40] PHP Fatal error:  Call to a member function setFetchMode() on a non-object in /var/www/html/forum/vault/core/controller/db/xf.php on line 133
      [Fri Jul 12 18:42:30 2013] [error] [client 23.23.48.40] PHP Fatal error:  Call to a member function setFetchMode() on a non-object in /var/www/html/forum/vault/core/controller/db/xf.php on line 133
      [Fri Jul 12 18:42:30 2013] [error] [client 23.23.48.40] PHP Fatal error:  Call to a member function setFetchMode() on a non-object in /var/www/html/forum/vault/core/controller/db/xf.php on line 133
      I added
      Code:
              public function query_read_slave($sql, $buffer = true)
              {
      debug_print_backtrace($this);
                      $this->instance->setFetchMode(Zend_Db::FETCH_ASSOC);
      
                      return $this->instance->query($sql)->fetchAll();
              }
      got
      Code:
      An exception occurred: debug_print_backtrace() expects parameter 1 to be long, object given in /var/www/html/forum/vault/core/controller/db/xf.php on line 132
      
      XenForo_Application::handlePhpError()
      debug_print_backtrace() in /var/www/html/forum/vault/core/controller/db/xf.php at line 132
      vw_DB_Controller_XF->query_read_slave() in /var/www/html/forum/vault/core/model/db/mysql/vw.php at line 29
      vw_DB_MySQL_Model->select() in /var/www/html/forum/vault/core/model/cache/vw.php at line 140
      vw_Cache_Model->get() in /var/www/html/forum/vault/core/model/node/vw.php at line 310
      vw_Node_Model->load() in /var/www/html/forum/vault/core/model/node/vw.php at line 26
      vw_Node_Model->one() in /var/www/html/forum/vault/core/controller/fetch/vw.php at line 46
      vw_Fetch_Controller->get() in /var/www/html/forum/vault/core/model/ui/tab/index/vw.php at line 34
      vw_UI_Tab_Index_Model->can_main_tab() in /var/www/html/forum/vault/core/model/ui/tab/vw.php at line 58
      vw_UI_Tab_Model->check() in vw/XenForo/CodeEventListener/Public.php at line 37
      vw_XenForo_CodeEventListener_Public::navigation_tabs()
      call_user_func_array() in XenForo/CodeEvent.php at line 54
      XenForo_CodeEvent::fire() in XenForo/Dependencies/Public.php at line 464
      XenForo_Dependencies_Public->_getNavigationContainerParams() in XenForo/Dependencies/Public.php at line 348
      XenForo_Dependencies_Public->getEffectiveContainerParams() in vw/XenForo/Template/Public.php at line 29
      vw_XenForo_Template_Public::fetch_template() in /var/www/html/forum/vault/core/view/template/xf.php at line 111
      vw_Template_View_XF->ready() in /var/www/html/forum/vault/core/model/vw.php at line 336
      vw_Hard_Core::fetch_template() in /var/www/html/forum/vault/core/view/stylevar/xf.php at line 58
      vw_StyleVar_View_XF->_construct_delayed() in /var/www/html/forum/vault/core/view/stylevar/xf.php at line 43
      vw_StyleVar_View_XF::getInstance() in /var/www/html/forum/vault/core/model/vw.php at line 186
      vw_Hard_Core::fetch_object() in /var/www/html/forum/vault/core/model/vw.php at line 302
      vw_Hard_Core::view() in /var/www/html/forum/vault/core/controller/css/vw.php at line 48
      vw_CSS_Controller->resolve() in /var/www/html/forum/wiki_css.php at line 50
      same if i
      Code:
      debug_print_backtrace($this->instance);
      =====

      so I replaced that with
      Code:
              public function query_read_slave($sql, $buffer = true)
              {
      ob_start();
      var_dump($this->instance);
      $result = ob_get_clean();
      print $result;
      and got what you'd expect ...
      Code:
      Zend_Db_Adapter_Mysqli
      emailed with subj more info #3179

      ----

      finally did
      Code:
      $a=get_class_methods($this->instance);
      ob_start();
      var_dump($a);
      $result = ob_get_clean();
      print $result;
      got
      Code:
      array(43) { [0]=> string(24) "getQuoteIdentifierSymbol" [1]=> string(10) "listTables" [2]=> string(13) "describeTable" [3]=> string(11) "isConnected" [4]=> string(15) "closeConnection" [5]=> string(7) "prepare" [6]=> string(12) "lastInsertId" [7]=> string(12) "setFetchMode" [8]=> string(5) "limit" [9]=> string(18) "supportsParameters" [10]=> string(16) "getServerVersion" [11]=> string(11) "__construct" [12]=> string(13) "getConnection" [13]=> string(9) "getConfig" [14]=> string(11) "setProfiler" [15]=> string(11) "getProfiler" [16]=> string(17) "getStatementClass" [17]=> string(17) "setStatementClass" [18]=> string(5) "query" [19]=> string(16) "beginTransaction" [20]=> string(6) "commit" [21]=> string(8) "rollBack" [22]=> string(6) "insert" [23]=> string(6) "update" [24]=> string(6) "delete" [25]=> string(6) "select" [26]=> string(12) "getFetchMode" [27]=> string(8) "fetchAll" [28]=> string(8) "fetchRow" [29]=> string(10) "fetchAssoc" [30]=> string(8) "fetchCol" [31]=> string(10) "fetchPairs" [32]=> string(8) "fetchOne" [33]=> string(5) "quote" [34]=> string(9) "quoteInto" [35]=> string(15) "quoteIdentifier" [36]=> string(13) "quoteColumnAs" [37]=> string(12) "quoteTableAs" [38]=> string(14) "lastSequenceId" [39]=> string(14) "nextSequenceId" [40]=> string(8) "foldCase" [41]=> string(7) "__sleep" [42]=> string(8) "__wakeup" } array(43) { [0]=> string(24) "getQuoteIdentifierSymbol" [1]=> string(10) "listTables" [2]=> string(13) "describeTable" [3]=> string(11) "isConnected" [4]=> string(15) "closeConnection" [5]=> string(7) "prepare" [6]=> string(12) "lastInsertId" [7]=> string(12) "setFetchMode" [8]=> string(5) "limit" [9]=> string(18) "supportsParameters" [10]=> string(16) "getServerVersion" [11]=> string(11) "__construct" [12]=> string(13) "getConnection" [13]=> string(9) "getConfig" [14]=> string(11) "setProfiler" [15]=> string(11) "getProfiler" [16]=> string(17) "getStatementClass" [17]=> string(17) "setStatementClass" [18]=> string(5) "query" [19]=> string(16) "beginTransaction" [20]=> string(6) "commit" [21]=> string(8) "rollBack" [22]=> string(6) "insert" [23]=> string(6) "update" [24]=> string(6) "delete" [25]=> string(6) "select" [26]=> string(12) "getFetchMode" [27]=> string(8) "fetchAll" [28]=> string(8) "fetchRow" [29]=> string(10) "fetchAssoc" [30]=> string(8) "fetchCol" [31]=> string(10) "fetchPairs" [32]=> string(8) "fetchOne" [33]=> string(5) "quote" [34]=> string(9) "quoteInto" [35]=> string(15) "quoteIdentifier" [36]=> string(13) "quoteColumnAs" [37]=> string(12) "quoteTableAs" [38]=> string(14) "lastSequenceId" [39]=> string(14) "nextSequenceId" [40]=> string(8) "foldCase" [41]=> string(7) "__sleep" [42]=> string(8) "__wakeup" } array(43) { [0]=> string(24) "getQuoteIdentifierSymbol" [1]=> string(10) "listTables" [2]=> string(13) "describeTable" [3]=> string(11) "isConnected" [4]=> string(15) "closeConnection" [5]=> string(7) "prepare" [6]=> string(12) "lastInsertId" [7]=> string(12) "setFetchMode" [8]=> string(5) "limit" [9]=> string(18) "supportsParameters" [10]=> string(16) "getServerVersion" [11]=> string(11) "__construct" [12]=> string(13) "getConnection" [13]=> string(9) "getConfig" [14]=> string(11) "setProfiler" [15]=> string(11) "getProfiler" [16]=> string(17) "getStatementClass" [17]=> string(17) "setStatementClass" [18]=> string(5) "query" [19]=> string(16) "beginTransaction" [20]=> string(6) "commit" [21]=> string(8) "rollBack" [22]=> string(6) "insert" [23]=> string(6) "update" [24]=> string(6) "delete" [25]=> string(6) "select" [26]=> string(12) "getFetchMode" [27]=> string(8) "fetchAll" [28]=> string(8) "fetchRow" [29]=> string(10) "fetchAssoc" [30]=> string(8) "fetchCol" [31]=> string(10) "fetchPairs" [32]=> string(8) "fetchOne" [33]=> string(5) "quote" [34]=> string(9) "quoteInto" [35]=> string(15) "quoteIdentifier" [36]=> string(13) "quoteColumnAs" [37]=> string(12) "quoteTableAs" [38]=> string(14) "lastSequenceId" [39]=> string(14) "nextSequenceId" [40]=> string(8) "foldCase" [41]=> string(7) "__sleep" [42]=> string(8) "__wakeup" }
      Reply Reply  
    11. July 12, 2013 9:56 PM
      rizwank rizwank is offline
      New Member
      This is driving me nuts, because i can establish that it IS an object by doing
      Code:
      print gettype($this);
      print gettype($this->instance);
      Reply Reply  
    12. July 12, 2013 10:03 PM
      rizwank rizwank is offline
      New Member
      I think it's a Zend bug.

      first, Zend_Db::FETCH_ASSOC = 2

      if I do
      Code:
      $this->instance->setFetchMode(0);
      then
      Code:
      An exception occurred: Invalid fetch mode '0' specified in /var/www/html/forum/library/Zend/Db/Adapter/Mysqli.php on line 478
      It's obviously an object.

      if I do
      Code:
      $this->instance->setFetchMode(2);
      then
      Code:
       [Fri Jul 12 18:58:42 2013] [error] [client 50.16.113.204] PHP Fatal error:  Call to a member function setFetchMode() on a non-object in /var/www/html/forum/vault/core/controller/db/xf.php on line 132
      ====
      when doing
      Code:
      ob_start();
      var_dump($this->connection);
      $result = ob_get_clean();
      print $result;
      it should have a connection, no? Maybe the connection wasn't established in advance????
      Code:
      An exception occurred: Undefined property: vw_DB_Controller_XF::$connection in /var/www/html/forum/vault/core/controller/db/xf.php on line 133
      
      XenForo_Application::handlePhpError() in /var/www/html/forum/vault/core/controller/db/xf.php at line 133
      vw_DB_Controller_XF->query_read_slave() in /var/www/html/forum/vault/core/model/db/mysql/vw.php at line 29
      vw_DB_MySQL_Model->select() in /var/www/html/forum/vault/core/model/cache/vw.php at line 140
      vw_Cache_Model->get() in /var/www/html/forum/vault/core/model/node/vw.php at line 310
      vw_Node_Model->load() in /var/www/html/forum/vault/core/model/node/vw.php at line 26
      vw_Node_Model->one() in /var/www/html/forum/vault/core/controller/fetch/vw.php at line 46
      Reply Reply  
    13. July 12, 2013 10:05 PM
      rizwank rizwank is offline
      New Member
      Finally ...


      http://stackoverflow.com/questions/1...n-a-non-object
      http://stackoverflow.com/questions/1...n-setfetchmode

      From code I've seen around the connection and query should be available before the setfetchmode.
      http://www.smarty.net/forums/viewtop...e89ab44d9f2a d

      Maybe this will fix your need to set it each time?

      http://stackoverflow.com/questions/1...pdofetch-assoc
      Reply Reply  
    14. July 12, 2013 11:57 PM
      pegasus pegasus is offline
      VaultWiki Team
      You want to wrap the test code you're adding in a conditional, so it only outputs when the error is about to happen:
      Code:
      if (!is_object($this->instance))
      {
      // some debug code
      }
      // error will happen on the next line
      Reply Reply  
    15. July 13, 2013 12:34 AM
      pegasus pegasus is offline
      VaultWiki Team
      I think I see how it happens. A function could be looping on itself. I will let you know more shortly.
      Reply Reply  
    Page 2 of 3 FirstFirst Previous 123 Next LastLast
    + 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 3:54 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 © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.