Hi
I think I have the same issue as "JSfriend" in "after update to current jomsocial to 3.1.0.1 i get ERRor in backend", see
www.jomsocial.com/forum/installation/120...get-error-in-backend
So I get...
PHP Fatal error: Cannot redeclare class CommunityModelPhotos in /var/www/tradesadvisor_c/new/components/com_community/models/photos.php on line 18, referer:
www.tradesadvisor.com/new/administrator/index.php
When I go to...
www.tradesadvisor.com/new/administrator/...option=com_community
Some background, I just updated the site from...
Joomla! 2.5.6 / JomSocial 2.4.2
...to...
Joomla! 3.2.1 / JomSocial 3.1.0.2
System details...
PHP: 5.3.2
MySQL: 5.1.72
Apache: 2.2.14
This is a development version of
www.tradesadvisor.com
, we're just addressing migration issues prior to a planned migration.
I had a search through the code, all php in my Joomla install, and didn't find two instances of CommunityModelPhotos in the "administrator" folder. I found...
Search "CommunityModelPhotos" (6 hits in 4 files)
administrator\components\com_community\models\photos.php (1 hit)
Line 18: class CommunityModelPhotos extends JModelLegacy
components\com_community\models\tags.php (1 hit)
Line 33: public function CommunityModelPhotos()
components\com_community\models\photos.php (3 hits)
Line 18: class CommunityModelPhotos extends JCCModel implements CLimitsInterface {
Line 24: public function CommunityModelPhotos() {
Line 947: * @return CommunityModelPhotos
components\com_community\libraries\core.php (1 hit)
Line 608: 'CommunityModelPhotos' => '/models/photos.php',
Any thoughts, suggestions, ideas or solutions?
Thanks
Hello Gavin
Can you try this fix?
Hi Sinisa
Thanks for the response, sorry for the delay getting back to you.
I copied over the update and now get a different error...
PHP Fatal error: Call to a member function getName() on a non-object in /var/www/code/tradesadvisor/tradesadvisor_4/libraries/legacy/view/legacy.php on line 493
...I'd guess that your fix may have saved one problem, but we have now run into another.
Any ideas?
Hello Gavin
Please try it on the fresh Joomla and JomSocial installation.
JomSocial does not call any function called getName() anywhere in the script and this issue can easily be raised by third-party plugin. My first advice is, try it in a clean joomla and JomSocial installation first.
Hi Sinisa
Thanks for your reply. I have done as you suggested and installed it on a fresh system, and it is working fine I think. So I think you're right in that this is caused by a 3rd party plug-in. I'll investigate further and see if I can trace the cause.
Incidentally, it does seem like JomSocial calls a getName function, see...
administrator\components\com_community\controllers\users.php
Line 150:
echo $user->id . ',' . $profileType->getName() . ',' . $user->name . ',' . $user->username . ',' . $user->email . ',' . $user->getThumbAvatar() . ',' . $user->getAvatar() . ',' . $user->getKarmaPoint() . ',';
administrator\components\com_community\views\photos\view.html.php
Line 143:
return $profile->getName();
administrator\components\com_community\views\users\view.html.php
Line 302:
return $profile->getName();
I thought this must be the case, as I only get this error when I click on "Components" -> "JomSocial" in the Joomla admin menu.
Thanks for your help.
Hi Sinisa
I was doing a bit of debug on this today and realised that I only got this error on the JomSocial admin dashboard. So, for example...
mysite.com/administrator/index.php?option=com_community
...gave the error, but...
mysite.com/administrator/index.php?option=com_community&view=configuration&cfgSection=site
...did not.
Then, I updated from JomSocial 3.1.0.2 to 3.1.0.4 and that fixed the dashboard altogether.
The only other change I made was to uninstall the Joomla Zend extension.
So I think we are ok now. I'll leave this open for a short time while I double check everything is fine.
Thanks
No problem Gavin, just monitor it and tell us if something is wrong