• Resolved sabre



    How to fix this problem:
    PHP Notice: Undefined property: Loco_hooks_AdminHooks::$router in /home/autodeal/www/wp-content/plugins/loco-translate/src/hooks/AdminHooks.php on line 59

    Thanks, guys!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tim W


    Hi. Thanks for this.

    The undefined property is my bad. I’ll release a patch for that ASAP.

    However, the reason I missed my error is that this situation shouldn’t be happening at all. If the admin menu callback is firing then the property should exist. Could you tell me more about your environment and when you see the error?

    Is it during Ajax, or a normal page view?

    Plugin Author Tim W


    The development branch fixes the undeclared property error.

    I was still unable to reproduce a situation where the error would occur though.

    Please let me know the the fix works, and if you can shed any light on what you did to catch it. Thanks.

    I can confirm this notice shows when AJAX request is made to async-upload.php.

    And I run on PHP 7.0.

    Plugin Author Tim W


    Thanks for confirming.

    Interesting that the admin_menu hook fires for async-upload.php, because it doesn’t for admin-ajax.php. Anyway, I’ve fixed the error in dev. Will go live in the next release.

    I also tried to apply the patch and it seems to work ok. Thanks for fixing.

    • This reply was modified 6 years, 4 months ago by Jiri Hon.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to fix PHP Notice: Undefined property: Loco_hooks_AdminHooks::$router’ is closed to new replies.