Ticket #119 (closed defect: needmoreinfo)
include_once errors in Widget object
| Reported by: | Texiwill | Owned by: | ofer |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6 - Current major |
| Component: | WordPress Plugin | Version: | 0.6.3 |
| Keywords: | transposh_plugin_dir | Cc: |
Description
Hello,
I see the following errors.... as $this->transposh->transposh_plugin_dir has no value within the widget object.
The first line is an output using error_log of this setting within the init of the widget object after $this->transposh is set.
[Tue Sep 07 22:25:18 2010] [error] [client 66.249.71.249]
Now if I print this information before init, it is also blank but that is because the setting of this variable is later in the code.
So this leads to these errors where include_once fails.
[Tue Sep 07 22:25:18 2010] [error] [client 66.249.71.249] PHP Warning: include_once(widgets/default/tpw_default.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /usr/share/wordpress/wp-content/plugins/transposh-translation-filter-for-wordpress/wp/transposh_widget.php on line 114
[Tue Sep 07 22:25:18 2010] [error] [client 66.249.71.249] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'widgets/default/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 on line 114
If I move the instantiation of the widget object to after the initiation of all the vars, the same error occurs. While $this->transposh_plugin_dir gets set properly in the main object it does not get set within the widget object.
Regards,
Edward

Hello Edward,
No matter how much I tried, I was unable to reproduce this bug or recreate it, I am setting this ticket on need more info, because I would like you to try two possible solutions:
1.Try moving this line
in transposh.php function transposh_plugin, to be just above the object instantiations
2.Try this code:
in load_widget:
if (!$this->transposh->transposh_plugin_dir) {
$this->transposh->transposh_plugin_dir = '../';
}
Please let me know how it went, and sorry about the delays here, feel free to open the bug at will