Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Fatal error: Cannot redeclare class JModelLegacy
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 4 (Joomla 1.6/1.7/2.5+ compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: Fatal error: Cannot redeclare class JModelLegacy

Fatal error: Cannot redeclare class JModelLegacy 11 years, 9 months ago #36736

Hi.
I am using RsFirewall on my site, the problem is that I can not access RsFirewall's backend after upgrade of ARTIO joomsef to version 4.3.
The error message is:
"Fatal error: Cannot redeclare class JModelLegacy in /administrator/components/com_rsfirewall/helpers/adapter.php on line 53"

I have investigated the problem.
Here is a fragment of diff for /administrator/components/com_sef/model.php after upgrade of ARTIO joomsef to version 4.3:
 
-class SEFModel extends JModel
+if (!class_exists('JModelLegacy')) {
+ class JModelLegacy extends JModel { }
+}
+
+class SEFModel extends JModelLegacy
 
Seems like it causes the problem.

The suggested patch to solve the problem is:
 
--- a/administrator/components/com_sef/model.php
+++ b/administrator/components/com_sef/model.php
 
-if (!class_exists('JModelLegacy')) {
- class JModelLegacy extends JModel { }
+if (!class_exists('JSEFModelLegacy')) {
+ class JSEFModelLegacy extends JModel { }
}
 
-class SEFModel extends JModelLegacy
+class SEFModel extends JSEFModelLegacy
 

Is there any other way to fix the problem without changing joomsef source code?

I would really appreciate any help.

Re: Fatal error: Cannot redeclare class JModelLegacy 11 years, 8 months ago #36806

  • dajo
  • OFFLINE
  • Posts: 5069
Hi,

I don't think that the problem is caused by JoomSEF, as our code correctly determines whether the class already exists and only declares it if it doesn't. The JModelLegacy class is standardly defined in Joomla 2.5.6 and newer, so I think that the code in RsFirewall is the one that should be fixed.
ARTIO Support Team
  • Page:
  • 1
User Login Empty