Darko Hrgovic's Blog

Menu active trails for views paths with arguments

Had an issue today where menu_block module wasn't showing when clicking a link to a view with argument.
Example: 
create a view with path 'my-view' and add a node id argument
create a link in a menu to my-view/1   (or whatever node you want to link to)
create a menu block on the menu where you created the link
clicking the link will not show the menu block
change the view path to my-view/% and all is well
Assume this announces the trail properly to menu_block so it knows we're at that path, where before it had no idea.
So our best practice going forward is to always add /% to the path for views with arguments.
 

Innovation

Agentic’s primary business is to create websites for clients in the not-for-profit sector using the open source Drupal CMS framework. A big question we regularly ask ourselves is whether we are “innovating” in our day-to-day work.

PHP 5.3.x . . . The Drupal Killer

A host that we refer a number of clients to recently decided it was a good idea to upgrade to PHP 5.3.x on one of our client's VPS's without informing us.
Suddenly, clicking through to a content page was WSOD, but only for certain content types. Frantic debugging begins, and of course there's no project hours to support this level of disaster.
Admin menu broke. Empty white space where it should be, and no "admin-menu" div in the source html.
Emfield broke. Empty white space where videos should play.
Too much other stuff broke to mention.
And then a simple phpinfo() surprise: PHP 5.3 magically appears a few days ago.
Another lesson in "never ignore the obvious" when debugging your suddenly broken site.

Taxonomy image, views, getimagesize 401 error

I created a view today with a taxonomy_image field, which complained with a 401 Authorization Required error, something like this:
getimagesize failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required
Took a hint from here: http://drupal.org/node/518794
Because our site is behind .htpasswd during devel, we need to add the following to the virtual host settings, which allows apache to access the directory: 
<Directory "/path_to_drupal/sites/all/files">
Allow from all
Satisfy Any
</Directory>
 

Drupal 7 eaccelerator issues

http://drupal.org/node/606304
disabling eaccelerator in .htaccess lets D7 work
php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

otherwise, we get the error:
PHP Fatal error:  Class 'FieldException' not found
Thanks to axper

Drupal Views Taxonomy Grouping Date Sort Issues

We had an issue today with Views 2 not grouping on taxonomy terms in anything but Table view.
We asked the view to group on taxonomy terms and sort on date field, but it really sorted by date field, and only looked like it was grouping (nodes with different taxonomy terms were mixed into the groups).
Removing the date field sort allowed grouping to work properly.
Again, works great in Table view.
 

Mozilla Service week event at Agentic Communications

Mozilla Service Week comes to Agentic.
Roland Tanglao of Mozilla Messaging and Dale McGladdery brought Mozilla Service Week to Agentic last Thursday.
Thanks to Phillip Djwa of Agentic for taking time out of his tremendously busy schedule to support us in this event. Kind thanks also to Karo for supporting the hosting of this event.

Date format on our blog

Just had a question about the date format on our blogs, so thought I'd share with everyone. Not sure if our developer (no longer with us) borrowed the technique from another source, but if she did then kudos to the other source.
A code snippet in node-blog.tpl.php and some css should do the trick:
<code>

Drupal namespace collisions

Why does my newly created clientname_block() hook kill all the blocks on my site? Because we also have a theme named clientname, which causes a namespace collision.
Changing the module name to clientnamemodule (and all function names) fixes it.
http://drupal.org/node/375674#comment-1560314

Drupal expand teaser to full body

We had the need to expand the teaser to full node body on click.

We created a view with both teaser and body, then we swap them with a bit of jQuery in the footer of the view: