Centralize your logs with logstash (getting started guide)

Logstash is a great tool to centralize logs in your environment. For example we have several drupal webheads that write logs into syslog. It would be really nice to see those logs somewhere centrally to find out about your system's health status and debug potential problems.

In this article I would like to show how easy to start using logstash for local development.

Render custom button

In this article we will show small code snippet that helps you to control very granular how to render submit buttons on your forms.

Panels control panes render sequence

Panels standard renderer has very flexible undocumented feature of controlling the sequence of panels being rendered.

By default you have possibility to use 'render first' and 'render last' in your content type definition so you already can control what pane should be rendered for example last. Undocumented part is more interesting that is hook_panels_panes_prepared_alter() that runs after all panes were set up. So you can alter the array of panes in which way you can control sequence of panes being rendered. This feature is super handy when you have dependent panes.

Varnish book review

Because our IT sphere develops so fast it is so easy to wake up one morning and understand that your knowledge about things got outdated. I have personally decided to restart my habit of reading technical books. Lately I have completed book about Varnish (https://www.varnish-software.com/static/book/) that I highly recommend to everyone dealing with web development.

Some snippets working with panels / panelizer

When we have a panels page in features and we want to move it to database we need to run

Using Chrome search engines for Redmine & Jira

I knew for pretty long time existence of Chrome custom search engines but just now got a huge benefit of it.

The idea is that you can define custom keyword to do a "search" in some website. What you do is you define a keyword "engine" and then when you type "engine keyword" browser will redirect you to custom specified url with substituting %s with your keyword.

Lets see examples.

Secure Jenkins with login/password

After default installation of Jenkins CI (http://jenkins-ci.org) admin UI is accessible by everyone.

Multiple AJAX forms on same page

Today I have had very interesting case with drupal forms having #ajax buttons. One form was working but the other didn't. After some debugging on ajax.js file I have found out that ajax submit buttoms behaviors being attached to forms by id so it is critical that different buttons have different id's. And in my case I have named submit buttons the same name $form['submit'] and in this way they had same id "form-submit". So in order to avoid that only thing you need is to make keys of submit elements in form to be different and then box ajax submission behaviors work as expected.

Panels taxonomy arguments

I have discovered very very nasty bug lately. When you export the panels page and it has taxonomy argument. Settings of argument do have machine name of the taxonomy vocabulary but it ties up to vocabulary id. This means that your panels page can break pretty easy in case you will happen to have your exported vocabulary to have different id. This may happen pretty often if you use features extensively for example when develop project in 'code-driven' way. Drupal.org ticket https://drupal.org/node/2270505

Debug backtrace

Devel is a great module that provides a lot of helper funcitons to debug your code. One of them I have discovered lately is ddebug_backtrace(). It gives very nicely formatted backtrace as a message. Great help for development!

Pages