Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

PHP Fatal error: Cannot redeclare class CommunityModelPhotos, j3.2.1

11 years 3 months ago
  • Gavin's Avatar
    Topic Author
  • Gavin
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Licenses:
JomSocial Expired

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

11 years 3 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

Hello Gavin

Can you try this fix?

This attachment is hidden for guests.
Please log in or register to see it.


Please unzip and replace according to structure


- Don't say feature not working. Instead, explain what you tried and what was the outcome.
- When you think you found the bug, try to replicate it on a fresh Joomla.
- When looking for support always provide temporary Super Administrative access to your site. We will ask for it anyway.
- Help yourself and read documentation which can give you answers to almost all questions you may have

This message has an attachment file.
Please log in or register to see it.

11 years 2 months ago
  • Gavin's Avatar
    Topic Author
  • Gavin
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Licenses:
JomSocial Expired

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?

11 years 2 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

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.


- Don't say feature not working. Instead, explain what you tried and what was the outcome.
- When you think you found the bug, try to replicate it on a fresh Joomla.
- When looking for support always provide temporary Super Administrative access to your site. We will ask for it anyway.
- Help yourself and read documentation which can give you answers to almost all questions you may have
11 years 2 months ago
  • Gavin's Avatar
    Topic Author
  • Gavin
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Licenses:
JomSocial Expired

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.

11 years 2 months ago
  • Gavin's Avatar
    Topic Author
  • Gavin
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Licenses:
JomSocial Expired

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

11 years 2 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

No problem Gavin, just monitor it and tell us if something is wrong


- Don't say feature not working. Instead, explain what you tried and what was the outcome.
- When you think you found the bug, try to replicate it on a fresh Joomla.
- When looking for support always provide temporary Super Administrative access to your site. We will ask for it anyway.
- Help yourself and read documentation which can give you answers to almost all questions you may have
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW