During configuration of Magento (in fact whole 1.7.x branch) you may encounter such error:

Database server does not support InnoDB storage engine

Of course your MySQL server has InnoDB enabled so what to do? Answer is simple but ugly, go to app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php and replace:


It is a common issue, you added:


but filtering just shows ajax spinner and not loading content? Check your grid class ([COMPANY]_[MODULE]_Block_Adminhtml_[CONTROLLER]_Grid extending from Mage_Adminhtml_Block_Widget_Grid) and if you don’t have getGridUrl(), it is the reason. Just add as shown:

keep in mind to match ‘*/[CONTROLLER]/grid’ to your controller, it should be gridAction() method in controllers/Adminhtml/[CONTROLLER]Controller.php with such content:

Po ponad dwóch latach prowadzenia bloga postanowiłem zmienić jego koncepcję – pierwotną ideą było pisanie o rzeczach które trudno wygooglować albo do których nie udało mi się znaleźć gotowego rozwiązania. Jednak jak widać po ilości postów wielu takich rzeczy nie ma, więc zamiast powielać coś co już inni napisali lepiej będzie pisać o tym samym (koniec końców 90% treści w internecie to przeredagowane kopie czegoś co już było) ale po naszemu. Czy okaże się to słuszne – zobaczymy.

Well, first rule – you should not do this. But if there is good reason, consider using such query for searching in index-based arrays:

In case you have assoc array serialized you can use:

Of course it won’t be very fast but in small tables should be enough

We all know Facebook SDK. It should be marked as beta. Or even alpha. Some things works one day, and few days after they are not. Such situation happened with sharer.php and its mobile browser detection. Using iPad 1 with iOS 5.1.1 (so it’s Safari 5.1) caused facebook to stay at its full version, but using device with iOS 7 (with Safari 7.0) triggered redirection to m.facebook.com. “So what?” some of you may thing. Well, nothing except broken sharing dialog. The solutions is not easy to google, but very simple – just add m2w as GET parameter and it will stick at full version this way:

Yes, it can be really painfull – MSSQL (at least instance I’m using) is saving date in format “d/m/Y H:i:s” but in every part of code I had “Y-m-d H:i:s”. So what now – rewrite everything? Nope, there is ugly but working way to do it, after ADODb object is created and initialized put:

and that’s it – all dates will be internally converted to given format, so here is full example of config:

At first look it was simple, just:

but, this way we can get ONLY posts, not pages. To get both posts AND pages just add:

in WP_Query arguments list so it will look like this:

And voila – we have both content types.

I faced with such problem: had one upload field for one file in my Zend_Form, and few checkboxes for choosing file destination. After form is submitted, this one file should be uploaded to each locations checked in form. So first idea was to loop through checked checkboxes, in each iteration set:

then do:

and it should be done, but its not. Problem is in

which is called BEFORE loop, and which can’t be modified INSIDE loop. After each receive() file is marked as already received and is not processed again. My solution was not state-of-art but works: files are received BEFORE checkbox loop, added to array, then loop is done and each file is copied where it should be. It looks this way:


From time to time previously serialized array will get broken. The most common problem occurs when string length is invalid so instead of

you have

becouse someone edited something directly in db, in this case to make php unserialize() function to work again, just do this magic:

and you will get all strings lenths to be fixed again.