mrtopher / dashEE

Control panel dashboard framework for EE CMS.
37 stars 5 forks source link

EE 2.6.x Widget Language File Issue #31

Open mrtopher opened 11 years ago

mrtopher commented 11 years ago

Widgets that are packaged with third party modules, and that leverage their modules language file, are experiencing issues with the language file not loading. The widgets name and description are displayed correctly in the widget listing but not when the widget is added to a users dashboard.

I believe this has something to do with scope issues introduced in the latest version of EE. It works on the widget listing because the dash module loads the language file and then uses it. When loading a widget, dash may load the language file but the widget class is what's referencing it and since that is a different scope I believe this is where the problem lies.

I'm still investigating but a quick fix to this problem is to simply load your modules language file in the constructor of your widget class using $this->EE->lang->loadfile() and everything should display correctly.