Keyword

Urgent help - Fatal error: Cannot redeclare class

  • swedeboy71
  • swedeboy71's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 month ago - 12 years 1 month ago #101712 by swedeboy71
Hello,

Hope someone can help us solve this issue.

When we try to save articles we're getting the following error

Fatal error: Cannot redeclare class K2HelperPermissions in /home/queermag/public_html/components/com_k2/helpers/permissions.php on line 15

This is the reply we got from our host

If in the code you include both of the files then you'll get this error. Essentially, you click save in backend and it goes to a particular php script. That script has includes or requires which take other scripts and include them (to use the code inside of those scripts). The scripts which are included have more includes and requires and so on. The first time you access (include or require) one of the files below the class gets declared. Then at some point another script includes another one of the files and the class tries to declare again which is what causes the error.

components/com_k2/helpers/permissions.j16.php
components/com_k2/helpers/permissions.php
development/components/com_k2/helpers/permissions.j16.php
development/components/com_k2/helpers/permissions.php

This is a programming safety feature so that all classes have to be declared and can only be declared one time.

After that reply we uninstalled the K2 component from our development server.

New response from our host

Yes, I see the two development files gone, but the two which are left are each have a call named K2HelperPermissions. I've looked at the classes and they are very different of one another. I was hoping they were the same so I could simply remove one of them and link the files together.

I've edited administrator/components/com_aceftp/quixplorer/_include/fun_admin.php and changed:

require "./_include/permissions.php";

To:

require_once "./_include/permissions.php";

Does this make any difference?

That didn't help

What can be wrong?

Right now we can't publish or save any articles


System Information

Web Server: Apache
PHP version: 5.3.15
MySQL version: 5.1.63-cll
GD image library: bundled (2.0.34 compatible)
Multibyte string support: Enabled
Upload limit: 20M
Memory limit: 232M
Open remote files (allow url fopen): Yes

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

  • swedeboy71
  • swedeboy71's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 month ago #101713 by swedeboy71
Problem solved.

It was Smart Search - K2" plugin that caused this.

After disabling that plugin everything was working again.

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

More
12 years 1 month ago #101714 by Neal Barnett

Anders wrote: Problem solved.

It was Smart Search - K2" plugin that caused this.

After disabling that plugin everything was working again.



Confirmed - I had the same error and disabling Smart Search solved it.

Is there a fix so that Smart Search can be added back?

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

More
12 years 1 month ago #101715 by Lefteris
Hi. I am trying to reproduce this. Any further information on this ( version numbers, other extensions etc. ) would be very helpful.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum