WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Transposh – translation filter for wordpress] Latest Transposh widget include incorrect

[Resolved] [Plugin: Transposh – translation filter for wordpress] Latest Transposh widget include incorrect

  • I see this in my logfiles

    [Tue Jul 13 10:50:46 2010] [error] [client 119.63.198.11] PHP Warning: include_once() [function.include]: Failed opening ‘widgets/tpw_default.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /usr/share/wordpress/wp-content/plugins/transposh-translation-filter-for-wordpress/wp/transposh_widget.php

    To fix I had to make several changes to the load_widget function in wp/transposh_widget.php. First to the definition of widget_src as transposh_plugin_dir is apparently NOT defined yet.

    //$widget_src = $this->transposh->transposh_plugin_dir . TRANSPOSH_DIR_WIDGETS . ‘/’ . $file;
    $widget_src = dirname(__FILE__).’/../’ . TRANSPOSH_DIR_WIDGETS . ‘/’ . $file;

    Second to the include of the default if widget_src is not there

    // include_once $this->transposh->transposh_plugin_dir . TRANSPOSH_DIR_WIDGETS . ‘/’ . $file;
    // include_once dirname(__FILE__).’/../’ . TRANSPOSH_DIR_WIDGETS . ‘/’ . $file;

    This lead to the inclusion of widgets/tpw_default.php which also required a change add the wrapper:

    if (!function_exists(“tp_widget_do”)) {

    }

    around the actual tp_widget_do else it gets multiply declared.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ofer Wald

    @oferwald

    Hello,

    I must ask if you ar you using the latest transposh.php file, the transposh_plugin_dir is actually the dirname(__FILE__) (through a wordpress function) and I see that it is empty in your case

    I also didn’t get how you get multiple declares, you are free to inform me

    Good luck,

    Still empty…. Still broken…. Still includes more than once.

    transposh_plugin_dir just gets set to empty string.

    Plugin Author Ofer Wald

    @oferwald

    Hello,

    Feel free to contact me by leaving a comment on transposh.org, I will be happy to take a deeper look into your settings in order to resolve this issue

    Well still broken. Only solution is to use what I already mentioned. Perhaps you need a conditional that says if it is set to null then use a defaul. And yes it still gets included more than once.

    Not sure what settings you need… I am definitely not messing with that variable anywhere.

    Plugin Author Ofer Wald

    @oferwald

    I think I know what happened, in your case it somehow happened that wordpress decided that the plugin is actually the default widget and not the actual plugin.

    So to fix that, either use the latest version from trac.transposh.org, or do the following actions.
    move tpw_default.php to a new subdir under widgets named default
    change the occurance of twp_default.php in the tp_widget.php code to be default/tpw_default.php.

    If the plugin listed in plugins says it needs to reactivate, it will probably mean I was right about that, the coming version will probably rid of this error, so thanks for reporting.

    Texiwill

    @texiwill

    Hello,

    Not really the problem. The problem is that the $this->transposh->transposh_plugin_dir variable has NO value in the widget object after instantiation.

    I have printed things out before init and then after init of the widget object. Has no value, hence why the code fails to load properly without modification.

    Best regards,
    Edward

    Plugin Author Ofer Wald

    @oferwald

    Hello Edward,

    Did you try my solution? can you contact me directly through the contact form on transposh.org so I will be able to resolve this completely?

    Thanks,
    Ofer.

    Texiwill

    @texiwill

    Hello,

    I opened ticket #119 on your trac but the Trac must have issues as it spits out errors everytime I try to logout then login… Makes this somewhat unusable.

    Now I cannot add anything to the ticket… Namely that if I pass $this (transposh object) to the widget instantiation code pass by reference nothing changes.

    Best regards,
    Edward

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] [Plugin: Transposh – translation filter for wordpress] Latest Transposh widget include incorrect’ is closed to new replies.