Fatal error: Cannot redeclare class ControllerCommonSeoUrl

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeFatal error: Cannot redeclare class ControllerCommonSeoUrl

This topic has been marked as resolved.

Hey ThemeBurn Support

Hoping you can solve this as the error is the only text displaying on the front end.

So I have upgraded the following to the latest versions:

  • OpenCart (1.5.6)
  • Shoppica 2 (2.2.4)
  • VQmod (2.4.1)

I now receive the following error only when Shoppica 2 is enabled.

Fatal error: Cannot redeclare class ControllerCommonSeoUrl in …/vqmod/vqcache/vq2-catalog_controller_common_seo_url.php on line 196

I believe this is being caused by the fact that I have a VQmod (opencart Blog Manager) that is modifying catalog/controller/common/seo_url.php. Maybe Shoppica is also requesting this class somewhere?

Any suggestions/fixes ?

Many Thanks,

Ross

 Rossh
September 17, 2013 at 10:14 pm #27583

Hey

So after looking into this myself I believe I have discovered the cause.

The VQMod check within tb_themes/shoppica2/library/Utils.php fails, as it no longer correctly identifies the latest version of VQMod as being installed (I guess because of some core changes to VQMod 1.4, as this error is not present with versions below this).

To fix this I have modified the function from


public static function vqmodCheck($filename)
    {
        if (!array_key_exists('vqmod', $GLOBALS)) {
            return $filename;
        }

        global $vqmod;

        return $vqmod->modCheck($filename);
    }

to the following (only checked with latest VQMod)


public static function vqmodCheck($filename)
    {
    
      if(!class_exists('VQMod')) {
          return $filename;
    }

        return VQMod::modCheck($filename);
    }

This is now working, as when my installed VQMod (Blog Manager in this case) modifies the seo_url.php file, it no longer causes the Fatal error (originally trigged by the doRouting function within CatalogDispatcher.php also requesting seo_url.php).

However as I have modified a core file, I’ll lose it if there are any further updates, so if this is stable and the best way of going about this please release it as a patch, as I have seen others with this problem around the web with no solution until now.

Also could you please let me know if this is stable as I am planning to use this fix on my live site!

Many Thanks,
Ross

  • This reply was modified 3870 days ago by  Rossh.
 Rossh
September 18, 2013 at 10:34 pm #27598

Solved this issue for me as well, this is a very good fix!

September 20, 2013 at 5:57 pm #27632

Hi,

Thanks for posting the patch here :)

We will add it in the next theme update.

Best regards,
Svetoslav

ThemeBurn team

September 25, 2013 at 4:01 pm #27726

Here’s more backward compatible replacement:

    public static function vqmodCheck($filename)
    {
        if (array_key_exists('vqmod', $GLOBALS)) {
            global $vqmod;

            if (is_callable(array($vqmod, 'modCheck'))) {
                return $vqmod->modCheck($filename);
            }
        }

        if(class_exists('VQMod')) {
            return VQMod::modCheck($filename);
        }

        return $filename;
    }

Regards,
ThemeBurn team

September 30, 2013 at 11:51 am #27794

Hej ThemeBurn team,

I’ve used the replacement you posted above after having the same problem with the Blog Manager. However, I get this error message now:

Fatal error: Class ‘Controllercommonseourl’ not found in /mnt/webh/e1/74/52607874/htdocs/oc/tb_themes/shoppica2/library/CatalogDispatcher.php on line 83

Before using your fix I deleted the “vq2-catalog_controller_common_seo_url.php” file in the vqcache to “solve” the problem. Can it have something to do with that file missing?

Thanks & best,
Torge

October 3, 2013 at 10:55 am #27894

@Torge

Have you tried to clear your entire vQmod cache folder and _ROOT/system/cache/ folder? Also, emptying the vqcache folder is never dangerous. You can safely delete all the files there as they are recreated automatically.

Best,
ThemeBurn team

October 8, 2013 at 2:08 pm #28014

I just purchased the AC CMS extension (like blog manager)
Not gone live yet, just messing around in our test shop.
I get this error on top of every page:

Notice: Undefined variable: override in /public_html/vqmod/vqcache/vq2-catalog_controller_common_seo_url.php on line 73

If I turn off SEO_URLS it disappears. I have also manually deleted the VQMOD Cache without any changes.
Any idease?

October 18, 2013 at 12:47 am #28239

@Bilkamera – which version of vqmod are you using ?

October 25, 2013 at 11:08 am #28380

Why havent this change been added to the latest version?

May 15, 2014 at 1:15 am #31875

9 days and no answer yet?

May 24, 2014 at 8:27 am #31995
You will need to register in order to post topics and read replies in the ThemeBurn.com support forums!
May 26, 2014 at 5:28 pm #32007

Hi, I made the changes shown in this thread, but I am still getting this error: Fatal error: Cannot redeclare class ControllerCommonSeoUrl in …/vqmod/vqcache/vq2-catalog_controller_common_seo_url.php on line 204

The addition I recently made was installing the All in one seo module by NerdHerd. I have Opencart 1.5.6.4.

My friend has an older version of Opencart (1.5.5.1) with Shoppica2 and the same module installed and he isn’t having this issue. Any ideas???

June 10, 2014 at 12:25 pm #32279

Hi @braevan,

we will need the website url, admin and ftp access, so we can check.

You can use hidepost to share private information with the support staff.

Regards,
ThemeBurn team

June 18, 2014 at 9:59 am #32351

HI,

I have the same problem.
I’m using:

Opencart: 1.5.6.4
VQMOD: 2.5
Shoppica: 2.2.4
SEO Mega KIT PLUSSEO Mega KIT PLUS 1.3.9.9.1

Error:

PHP Fatal error: Cannot redeclare class ControllerCommonMaintenance in /home/xxxxxx/public_html/shop/vqmod/vqcache/vq2-catalog_controller_common_maintenance.php on line 63

September 1, 2014 at 12:11 pm #32971
Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.