Thanks to all who took the time to take the poll. The participation was great! Over 350 respondents, which is a number in excess of 10% of the DrupalCon attendance. There were couple comments that I'd like to address:
DON'T HACK CORE! It's THE cardinal rule of Drupal. Like another rule, Don't eat yellow snow, it's inviolate...immutable...or is it?
There is one circumstance when hacking core is a good thing. "Really?" you ask. Yes, definitely. Hacking core is a great way to find out how a particular part of Drupal is working, particularly if you can't use something like xdebug. In that case, if you want to see what the world looks like when you get to a certain place in the code, there's nothing better than sticking in some debug code. There are, however, some precautions you should take:
I was listening to Webchick's presentation on Upgrading YOUR Module to Drupal 8 (https://www.youtube.com/watch?v=wKdU2Q1NIZQ), following along with my own contributed module (https://drupal.org/project/node_theme) and when she reached a seemingly innocuous step
- drush dl drupalmoduleupgrader
- cd drupalmoduleupgrader
- composer install
I received the following response in my Mac terminal window
There are times when the connection to your Drupal DB will need to be via ssl, such as when using an external DB service like clearDB. How do you accomplish this with regards to the settings.php file?
Add the following to your database array:
'pdo' => array (
PDO::MYSQL_ATTR_SSL_CERT => 'path-to-cert.pem',
PDO::MYSQL_ATTR_SSL_KEY => 'path-to-key.pem',
PDO::MYSQL_ATTR_SSL_CA => 'path-to-ca.pem',
To be, or not to be, that is the question. Shakespeare never quite gets around to answering it, though. In Drupal 7, a similar existential question arises regarding entity references: Is it, or is it empty? Unlike Will, we can answer this question.
With other field types, we can check to see if the field is empty by doing something like this:
if (sizeof($form_state['values']['field_x'][LANGUAGE_NONE]) > 0)
I had an issue recently, where I was using a selector to add menu tabs to the edge of the content area. Getting them to appear wasn't the issue. Getting them NOT to appear on admin overlays was.
The body class on which my selector was based didn't change when an admin overlay covered the page. It was still .front. So, how to do the equivalent of the following pseudo-code?
if body class = front but not an admin overlay?
What DOES change in the markup is the html tag. It has the class
The standard Drupal comment approval admin page has always been an annoyance to me. The main reason I will toss a comment is that it's spam. You know, like "I love this blog. For a great 3-day cruise..." and the like. The problem with the approval page is that it shows everything BUT the comment.
.swf files contain the information necessary to display Flash animation. In Drupal 6, there was a module that provided an api function swf() to generate the embed code needed. That module isn't available in Drupal 7 ... so what to do?
Are you working in a multi-server environment, such as local, staging and production? If you don't have User 1 (or some other user) access in your local setup, it's easy to remedy.
Enter drush and its user-password (upwd) command. Changing a password is a cinch, whether you know the existing one or not, if you have drush access to the site, which you hopefully do, on your local development server.
drush upwd <username> --password="<new password>"
drush upwd admin --password="let-me-in"
If you've been using Drupal for awhile, you probably understand template hinting and how you can format one content type differently than another, by having a template file such as
Recently, however, I had the need to format a single content type differently depending on where it was presented: