Blog: php

Nacho Salvador's picture
Nacho Salvador

How to verify that your code conforms to the coding standards

Coding standards or programming style describes a set of rules by convention to guide us how to write code. Basically, this set of rules describes how to format code regarding indentation, variable names, conditional sentences, etc.

This way the code of a project is more homogenized so it allows the people participating in a project easily understandable.

Drupal also has his own coding standard to develop and contribute modules. When we’re coding trying to follow this...

Rodrigo Aguilera's picture
Rodrigo Aguilera

How to skip node access issues during a cron process

Few days ago in Ymbra we had a challenge about how to load Drupal 7 entities during a cron job. The main issue here is that cron doesn't run with enough credentials and we need higher permissions to perform some operations.

Those entities had user access restrictions in place and when cron runs as anonymous user (even if you trigger it logged in as the user with id=1) those restrictions were respected and we weren't able to load our entity content to be later sent in an email.

So what can we do to run cron as Drupal admin?

In a...

Subscribe to RSS - php