Jump to content

Fatal error: Cannot redeclare class Mobile_Detect.php


GJNR

Recommended Posts

Hi

I just install the new HWDMediaShare component and I can make it work.

The page with content in HWDMediaShare shows this error:

 

Fatal error: Cannot redeclare class Mobile_Detect in /public_html/components/com_s2framework/vendors/mobile_detect/Mobile_Detect.php on line 11

 

So, I posted this error in their support forum, and the answer was:

Our usage of this class prevents this type of error. By that I mean that before we load the Class, we check if it is already loaded!

 

if (!class_exists('Mobile_Detect'))

               {

                       hwdMediaShareFactory::load('mobile.mobile_detect');

               }

 

However, it seems that the S2Framework does not check for this, and is loaded second.

 

They will need to modify their code to prevent this type of conflict with other software that also uses the Mobile_Detect class.

Link to comment
  • 4 months later...
  • 3 months later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...
×
×
  • Create New...