Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: [SOLVED] DT Register conflict with EasyBlog

[SOLVED] DT Register conflict with EasyBlog 14 years 1 month ago #10015

  • rick76
  • rick76's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0
I seem to be running into a conflict issue between the latest version of DT Register (2.7.0e) and EasyBlog (1.1.116). Here's the message I get when I try to access the blog:

Fatal error: Cannot redeclare pr() (previously declared in /home1/abundap6/public_html/simplymanaging/components/com_easyblog/constants.php:89) in /home1/abundap6/public_html/simplymanaging/administrator/components/com_dtregister/lib/defines.php on line 148

The URL to my development site is http://simplymanaging.allencreative.net
Didn't have a problem with EasyBlog before upgrading DT Register (I was running 2.6.9 previously).

Is there a way to resolve this? Or am I going to need to find a different blogging component?

Thanks!

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

[SOLVED] DT Register conflict with EasyBlog 14 years 1 month ago #10038

  • rick76
  • rick76's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0
I received some help from one of the EasyBlog techs. He said the following:

EasyBlog will check whether if the pr function had already been declare or not before declaring. So it shouldn't have a problem here.

From my guess, this issue occurs because most likely EasyBlog runs earlier than DT register on your site and EasyBlog declared the pr function (because this function does not exist at this moment) and when DT register runs they proceed to redeclare pr function despite the fact that it was already exist and hence creating the cannot redeclare function error.

I can provide a quick workaround. Open the file JOOMLA/components/com_easyblog/constants.php and at the very end of the file either comment or remove the following block of code.

if( ! function_exists ( 'pr' ) )
{
   function pr($var, $array = false) {

      if ( $array ) {
         echo '<pre>';
         var_dump($var);
         echo '</pre>';
      }
      else {
         echo '<pre>';
         print_r($var);
         echo '</pre>';
      }
   }
}

This function is not crucial to EasyBlog's overall functionality as it is use mostly for debug purposes therefore it is rather save to have it commented or removed until DT register get back to you.


Although it is a bit of a workaround, this solution resolved the conflict on my site. If anyone at DTH has a better solution, let me know, otherwise I'll just go with this.

Thanks.

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

[SOLVED] DT Register conflict with EasyBlog 14 years 1 month ago #10062

  • dthadmin
  • dthadmin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
We just updated the package to 2.7.0f and included a fix so this type of issue will not happen again. Like the EasyBlog tech told you, pr() is used for debugging mainly. Anyway, issue solved now. Thanks.

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

  • Page:
  • 1
Time to create page: 0.114 seconds