Guest
15 Jun 2012 12:12

Warning: sprintf() [function.sprintf]: Too few arguments in /var/www/html/customers/politicaboricua/libraries/joomla/methods.php on line 320

Fatal error: Call to a member function getName() on a non-object in /var/www/html//components/com_cobalt/library/php/community.php on line 110

See here:

http://www.politicaboricua.com/index.php?option=com_cobalt& ;view=record&id=1&Itemid=803

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
16 Jun 2012 07:48

To understand what really happening please could you edit file

/var/www/html//components/com_cobalt/library/php/community.php

and change lines 31-35 to this and let me see what will be error like.

if(!class_exists($name))

{

    JError::raiseError(404, JText::sprintf('CERR_COMMUNITYCLASSNOTFOUND', $name));    

    return false;           

}

Also check if file

/var/www/html/administrator/components/com_cobalt/library/php/community/com_cobalt.php is exists.


Guest
16 Jun 2012 12:30

Hi:

First after change code you mention results is:

Fatal error: Call to a member function getName() on a non-object in /var/www/html/customers/politicaboricua/components/com_cobalt/library/php/community.php on line 110

Second, the file /var/www/html/ administrator/components/com_cobalt/library/php/community/com_cobalt.php is present


Sergey
Total posts: 13,748
16 Jun 2012 21:07

That is strange. Did you change whole part of code? Did you change raiseWarning to raiseError?

PLease check if file com_cobalt.php have a content.


Guest
16 Jun 2012 23:29

Hi:

Yes I changed to raiseError

2- File have content. Wonder if correct class name is CCommunityCom_cobalt


Sergey
Total posts: 13,748
17 Jun 2012 00:28

Yes this is correct class.

You can either provide me super admin access to your site or try to debug yourself. I can explain what t do. Because I do not know what can be the reason of this error.


Guest
17 Jun 2012 02:15

Hi Sergey:

Please explain what to do.


Sergey
Total posts: 13,748
17 Jun 2012 06:36

OK.

In the file

/var/www/html//components/com_cobalt/library/php/community.php

Find this block at line 27

            $file = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_cobalt'.DS.'library'.DS.'php'.DS.'community'.DS.$component.'.php';



            include_once $file;

            $name = 'CCommunity'.ucfirst($component);

            if(!class_exists($name))

            {

                JError::raiseError(404, JText::sprintf('CERR_COMMUNITYCLASSNOTFOUND', $name));    

                return false;           

            }

            $class = new $name;

Now first you have to check if path to file is correct. and make

echo $file;

exit;

Right after $file = JPATH_.......

If it is correct, add

echo $name;

exit;

right after $name - 'CComm.......

And check that name of the class exactly the same as in file with was in $file.

If everything is correct, then I give up!


Guest
17 Jun 2012 13:08

Hi:

$file echoes:

/var/www/html/customers/politicaboricua/administrator/components/com_cobalt/library/php/community/com_juser.php

$name echoes: (placed after $name = 'CCommunity' ucfirst...

CCommunityCom_juser

Curious if I place the echo $name after before the $class= $name; I get:

Fatal error: Call to a member function getName() on a non-object in /var/www/html/customers/politicaboricua/components/com_cobalt/library/php/community.php on line 111

Please note I have JomSocial 2.6.2 installed.


Guest
17 Jun 2012 13:10

$name echoes: (placed after $name = 'CCommunity' ucfirst...)

CCommunityCom_juser

Curious if I place the echo $name before the $class= $name; I get:

Fatal error: Call to a member function getName() on a non-object in /var/www/html/customers/politicaboricua/components/com_cobalt/library/php/community.php on line 111


Sergey
Total posts: 13,748
18 Jun 2012 07:03

Edit global Cobalt config and change community integration to com_cobalt. com_juser not supported. SOmehow this old params get in.


Guest
18 Jun 2012 09:17

Hi Sergey:

Yes that was the problem. Fixed! I think you need to change something in code too to help users refrain from using juser.


Sergey
Total posts: 13,748
18 Jun 2012 23:22

I have already added hack in to code against this case.

Powered by Cobalt