cancel
Showing results for 
Search instead for 
Did you mean: 

Widget Issue on Linux but not on OSX

Widget Issue on Linux but not on OSX

I built a widget called "TopImage" for admins to drop into CMS pages and it worked great in my local development environment on OSX, but when I deployed it to the staging server the widget wouldn't work. After 5+ hours of head-scratching I discovered the problem was due to the way the lowercase form of the widget name in widget.xml was not being translated the same way on the different platforms, i.e. "topimage" was being translated to "Topimage" and it didn't matter that the actual class name was "TopImage" on OSX, but on Linux it caused the widget load to fail with no error messages to be found.

Anybody ever run into this kind of thing before? What are some good ways to debug these kinds of problems so I don't have to spend so much time on problems like this in the future?

 

TIA,

Andy Fillebrown

 

1 REPLY

Re: Widget Issue on Linux but not on OSX

I have seen this problem a lot from Windows -> Linux but I have never seen it in OS X. Since OS X basically follows the same Unix Principles Linux does. Here's what I'd do: 

 

* Media files are always named lower case

* All class files are named with capital letter (Foobar), never with CamelCase (FooBar)... I have found that camel case brings chaos to your code in one shape of form or another. Now Magento really allows for CamelCase and uses it (SalesRule) so this is not a definite rule.

 

Linux will always differetiate betweem lowercase and any other case so play it safe. Debugging wise, I always try to instatiate the class directly in a test file, you'd get a "exists" or "can't be found" kind of response.