Why Drupal module developers should be excited about object-oriented hooks
- Read more about Why Drupal module developers should be excited about object-oriented hooks
- 5 comments
- Add new comment
If you write custom Drupal 8 (or 9) modules, then you've probably used the entity QueryInterface - which is accessible from the Drupal::entityQuery() static method. If not, then you're missing out on this incredibly useful tool that allows you to easily query a Drupal site for entities of any kind.
I recently made the switch from another (several) code editors to PhpStorm based on the recommendations of several members of the Drupal community - not to mention all the postive things I've heard about it on IRC and various other places.
My main motivation for making the switch was the ability to have a integrated debugger - both when running Drupal in a web browser and via Drush. While there are plenty of resources online demonstrating how to set up the debugger, I found that I needed to do a combination of things to make it happen
We are all very familiar with the White Screen of Death in the Drupal world, AKA WSOD. One very common cause is a lack of memory for PHP - yet another is having errors turned off.
In development mode, you should probably make sure you are showing PHP errors on the screen, if this is an option. This is the kind of thing you can edit in your site-specific settings.php file, by using:
We love Drush, Drupal's all-purpose command-line tool, for people who can't stand checkboxes. It's fast, efficient, plays nicely with Version Control Systems like CVS, SVN and Git, and even cleans the kitchen sink. However, after moving our DrupalEasy.com site to a new server we encountered a minor snag. When trying to run even the simplest of Drush commands, we were faced with the following error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 311296 bytes)
A friend recently came to me with the following question:
I have a site that has a mode optimized for low-bandwidth use. Can I change the number of rows returned by a view based on the theme?
The Views 2 API has a function called hook_views_query_alter() which allows you to modify the View object before it pulls the results from the database.
In order to use views hooks, you must create a module that registers itself as using the Views API:
One of my sites had a funny error complaining about an "unsupported form of compression" shortly after installing a new module. The browser would return a white screen of death with an error message (Safari and Firefox).
Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.