• Resolved gabeshaughnessy

    (@gabeshaughnessy)


    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • what exactly is the error? can you copy paste here the whole error?

    Thread Starter gabeshaughnessy

    (@gabeshaughnessy)

    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.

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[plugin mage enabler] conflict with __() function after changind mage.php addres’ is closed to new replies.