Anthony Sidashin

Anthony Sidashin

As a web developer and CTO with over 15 years of experience, I am passionate about building profitable small SaaS products and pursuing Go-to-Market strategy for them. My areas of expertise include high performance, networking technology and APIs, SRE, automation using Puppeteer.js, web scraping, and SQL databases.

Drupal 7 vs Symfony 2: overview after 1 year of Symfony development

We've decided to switch to Symfony2 development in July 2012, if I'm not mistaken - after 7 years of (mostly) Drupal development. There were reasons to do that: 1. Not-too-great experience with high load projects, powered by Drupal 7 Okay, Drupal is good enough until you get a project with big expectations in terms of response time for authenticated users. Nginx proxy, boost and memcached help a lot with anonymous page hits, but things are sometimes not good enough when we talk about authenti

8 min read

Storing monetary amounts in db? Use decimals, not floats!

Lot's of people will be surprised (or shocked, when it happens in production) when they see that mysql can work like this: Query: SELECT transaction_id, amount FROM transactions WHERE amount>20.5 Response: 123|20.5 Query: SELECT transaction_id, amount FROM transactions  WHERE amount=20.5 Response: No rows So, 20.5 is really greater than 20.5 in sql database. Sometimes. Oh yeah, it looks like balance_tracker developers were not aware of that (until today). So, it's like a bomb with timer fo

1 min read

Rules won't work properly when run during cron, if you use node access restrictions

I've recently created USPS tracking module for Drupal, so Qwintry.com users could get notifications when their international packages change state. I've used queue operations to build requests to USPS API by cron, and it seems to work great for our customers, but this story is not about the module. My plan was to provide rules event "The package [tracking number] changed active state from [old state] to [new state]". (words in square brackets are Rules arguments). On Qwintry website, "Package"

1 min read

Image title as text description for colorbox image formatter (Drupal 7)

When you have core "image" field on your node type and you want to output "title" (or "alt") of this image just under the image thumbnail as text - you can use imagecaptionformatter module for that. But only in the case when you don't need another image formatter in place - e.g. Colorbox - because Colorbox provides its own image formatter, and imagecaptionformatter module also provides its own image formatter. You obviously can't use two formatters at the same time. So, when I was asked to set

1 min read

Be careful with drupal_get_form() in theme layer

When you create Drupal code for 7 years, it's easy to mistakenly assume that you know everything regarding such basic things as theme_preprocess_node() and drupal_get_form() functions. And that is a wrong feeling. Today I've discovered that you shouldn't mix these functions! The bug description: I was creating "join" form which was rendered in node.tpl.php of organic group. When the form was submitted, validation/status messages were shown only after additional page refresh. So, after form subm

1 min read

Improving user experience: using Dialogs for profile edit in modal forms

We are now developing big Drupal 7 project where users have profiles with lots of fields. They also have a node tied to them ("My story") which is created during registration. Initially, these were "edit my profile" and "edit my story" links which were leading to a huge forms where user was scared by amount of elements. So, basically, user has separate small form for photo upload, separate form for about field, and separate form for small details. I can tell you that filling in the profile in

4 min read