WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
[resolved] [Plugin: Transposh - translation filter for wordpress] Latest Transposh widget include incorrect (9 posts)

  1. Texiwill
    Member
    Posted 4 years ago #

    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.

  2. Ofer Wald
    Member
    Plugin Author

    Posted 4 years ago #

    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,

  3. Texiwill
    Member
    Posted 3 years ago #

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

    transposh_plugin_dir just gets set to empty string.

  4. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    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

  5. Texiwill
    Member
    Posted 3 years ago #

    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.

  6. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  7. Texiwill
    Member
    Posted 3 years ago #

    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

  8. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  9. Texiwill
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic