gabeshaughnessy
Member
Posted 1 year ago #
I'm using the mage enabler plugin, and I've had it workign just fine.
when I changed the mage.php address, I got an error telling me there was a conflict between a wordpress function called __() in the file l10n.php in my wordpress wp-includes.
when I comment out that function, I get an error undefined function (logically).
the conflict is with a function in the app/code/core/mage/functions.php file also named __().
when I comment out that function, no error, and the plugin no longer gives me the conflict error. however, I just edited the magento core files and removed a function, which is bad practice and will probably break my store down the road. Is there a better way to fix this?
Richard Feraro
Member
Posted 1 year ago #
what exactly is the error? can you copy paste here the whole error?
gabeshaughnessy
Member
Posted 1 year ago #
Reading through mage enabler threads I have found a couple references to this conflict, and found that disabling the Magento function was in fact the standard approach. I just wonder if there is a way to do this without editing the core magento files?
here's the error I was getting full text:
Fatal error: Cannot redeclare __() (previously declared in /home1/camobear/public_html/test_store/blog/wp-includes/l10n.php:96) in /home1/camobear/public_html/test_store/app/code/core/Mage/Core/functions.php on line 93
I was able to prevent the error by putting the magento function in a conditional, like this:
if (!function_exists('__')) { function __() { return Mage::app()->getTranslator()->translate(func_get_args()); } }
I'm pretty sure I got that from your blog.
Richard Feraro
Member
Posted 1 year ago #
Yeah, that's the instruction found in item no. 1 in the Installation tab of the plugin. Follow it, there's a better way of extending the core files by moving it to local directory.