Kunena 5.1.15 Released (27 Oct 2019)

The Kunena team has announce the arrival of Kunena 5.1.15 [K 5.1.15] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.

Question Call to a member function getAttribute() on a non-object while installing Kunena 1.5.14

8 years 9 months ago #11 by hkp
The installation process for K 1.5.14 kicks in from these lines in the file kunena.install.php

89: //install & upgrade class
90: $fbupgrade = new fx_Upgrade("com_kunena", "kunena.install.upgrade.xml", "fb_", "install", false);
92: // Start Installation/Upgrade
93: $fbupgrade->doUpgrade();

So here they created an instance of this class fx_Upgrade, the definition of which can be found in fx.upgrade.class.php

The line which is the culprit in this file is located here (line 255)

254: $installElement =& $root->firstChild;
255: $version = $installElement->getAttribute( "version" );
256: $versiondate = $installElement->getAttribute( "versiondate" );
257: $build = $installElement->getAttribute( "build" );
258: $versionname = $installElement->getAttribute( "versionname" );

The error message says >> Call to a member function getAttribute() on a non-object in <<PATH TO YOUR JOOMLA INSTALLATION>>/fx.upgrade.class.php on line 255
Which means $installElement above is not a valid object, it is supposed to be initiated by the code on line 254, which means that the call to $root->firstChild returned an invalid object reference.

Looking at how $root is instantiated on these lines

244: //initiate XML doc
245: $xmlDoc = new DOMIT_Lite_Document();
246: $xmlDoc->loadXML( $this->_upgradeDir .DS. $this->xmlFileName, false, true );
248: //load root element and check XML version (for future use)
249: $root = &$xmlDoc->documentElement;
250: $comUpgradeVersion = $root->getAttribute( "version" );

we figure that $root is nothing but the handle to a XML document located in the file kunena.install.upgrade.xml in the install folder of the administrator component folder.

the above answers question 2 of pralhad.rajgor, question 3 is irrelevant, and as for question 1, the class "DOMIT_Lite_Document" is a generic class in the libraries/domit and is used for loading XML documents from XML files.

So finally based on the above analysis we are left with the following pointers, that the above mentioned XML file is missing or is corrupt. This could be the only reason why the XML document object was not correctly formed and which then answers why $root->firstChild did not return a valid object.

the file kunena.install.upgrade.xml is very much present, however on windows machines you will see that on line 3 & line 348 you find a special character (the character for spelling Community in Italian), this character is what is causing the XML parser used by DOMIT_Lite_Document to fail, remove this special character and you should be fine !

The following user(s) said Thank You: nZambi, tithij

Please Log in or Create an account to join the conversation.

8 years 9 months ago #12 by pralhad.rajgor

Please Log in or Create an account to join the conversation.

8 years 3 months ago - 8 years 3 months ago #13 by o-sup

getAttribute() Error occurs when reading kunena.install.upgrade.xml

<?xml version="1.0" ?>
<comupgrade version="1.0">
<install version="1.5.14" versiondate="2011-01-31" build="1907" versionname="Comunit (Italian for: Community)">
<query>CREATE TABLE IF NOT EXISTS `#__fb_announcement` (
`id` int(3) NOT NULL auto_increment,

Perhaps getAttribute() method can't read Italian character.

I replaced versionname to "Community".
Last edit: 8 years 3 months ago by o-sup.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.114 seconds