image link to hive image link to ko-fi


Drupal 7 notes - forms with file field reloading page without going through form validation

I had a problem shortly after setting up ownCloud and Piwik where forms on all of the Drupal sites on my server mysteriously stopped working. But not all of them, only the ones with a file field. When hitting the submit button on those forms (and it didn’t matter what the form was, the presence of a file field was enough) the form validate wouldn’t trigger, the page would simply reload.

Webmonkey notes setting ssl piwik and owncloud under subdomains linode

As per usual part tutorial and mostly notes for me and anything with ridiculous names (e.g. username and domain) means replace with your information. Ingredients 1 Linode (this one has my referral attached because I’m a bastard like that) or equivalent 1 copy of Piwik 1 copy of ownCloud Server (grab clients for your devices while you’re there if you like) 1-2 ssl certificates (depending on whether you can use wildcard certificates and are going to be running Piwik and ownCloud from the same domain, I like StartSSL but any certificate from anywhere will work) I downloaded Piwik directly to the Linode (saves two steps of downloading it and then uploading it, plus my upload speed is crap) and ownCloud conveniently has many packages.

Have you tried turning it off and then on again?

This morning, when I crawled out of bed and tackled the morning coffee sites to be followed by 3d work before our busy day commenced, I noticed that my server was slow. There goes my 3d time again, sigh. Now I would have quickly investigated, if it hadn’t taken FOR FREAKING EVER to log into the server, and I had to leave before it had logged in, and unsurprisingly the pipe had broken and annoyingly the problem hadn’t resolved itself when I was able to tackle it again later in the day.

Drupal 7 install profile stuff that everyone else magically knows

Seeing as I found little to nothing when searching for how to configure individual role permissions, editor settings and enabling contrib filters with an install profile, I made something on the off-chance it helps some other poor sap like me who doesn’t automagically know where to look for these things. Enabling filters provided by contrib modules Search in the .module files for _filter_info. Some modules use the same format as Drupal filters of $filters['modulename_filter'], others don’t.

Drupal 7 notes: node or page template by path

Because I always seem to manage to completely forget how to do something this basic. template.php in theme_preprocess_page(&$variables) or theme_preprocess_node(&$variables) <?php $path = drupal_get_path_alias(); if (strpos($path, 'part_of_url') !== false) { $variables['theme_hook_suggestion'] = 'page__whatever'; // or node__whatever if using in a node preprocess } ?> This work is marked with CC0 1.0 Universal

Drupal 7 upgrade from HELL

Modded to be slightly more useful as I wrote the other one while slightly delirious. upgrade to latest D6 drush arb default --destination="wherever/you/like" mysql update systemsetstatus='0' where filename like 'sites%' delete 6.x, retain /files and /sites directories, remember any mods to .htaccess drop in 7.0 files drush updb if no error, press y if error occurs, make a note of what you need to do to fix it. If this is a repeat run, fix all errors noted rename/move your Drupal directory (or delete it but in the event you need it later) from above where the Drupal directory should be, drush arr [backup-filename-without-square-brackets].

Drupal notes: backup process with drush

There’s probably a script for this. Or maybe drush is the script. Is all good, some things are done much faster with commandline :) drush vset maintenance_mode 1 drush cc all drush arb default --destination=../[site]-[date].tar And if there’s updates to be done: drush up -y At the end: drush vset maintenance_mode 0 This work is marked with CC0 1.0 Universal

Blog updates, or mile long sidebars

I can’t even count in miles. I was a touch concerned about adding anything else to the sidebar as it’s already quite long. Then I had a look at the sidebars some of my friends and other miscellaneous people have on their blogs and I don’t feel too bad adding a couple of blocks. Then of course there was a mental kerfuffle about folds and whether blocks should be above or below them.

Sharing is...

…privacy concerning if you’re one of those people that object to things like tracking you around the internet, and not a big deal if you’re not. It bugs me a little bit (especially as I realised recently that I’d forgotten to mention tracking cookies and scripts etc that would have been coming from the share module I was using in my privacy thing) so in the event it bugs anyone who happens to drop by I’ve replaced the module I was using for sharing with [Social Share Privacy](Social Share Privacy).

Brain implosion imminent. Or what's been happening.

My head. It’s so full of stuff that I have a very mild persistant headache. The cold isn’t helping either, it makes my shoulder hurt. I’m glad I don’t live somewhere that’s actually cold. Following is a thought dump so I can work out what I’m doing and so anyone that cares can now know why techno was gone for the last month and why I’ve been in such a ridiculous distracted foul mood.