User login

Complete

To be used with care. Pages are complete only when they meet the posting guidelines.

Using Git submodules to share modified Drupal modules across sites

This reference is currently somewhat specific to Agaric's setup. We currently use Drush to update modules rapidly on a per-site basis (rather than updating a module in a central location and pushing it to the sites that use it), but certain modules have special needs (extra files, a patch that needs to be applied and hasn't been committed to Drupal.org version control yet) and when these modules have to be used on multiple sites, we can save time by bringing them in as submodules. Here are the notes from the first time we did this.

Register a channel on IRC

I did this (in the agaric room, but I think it can be done anywhere):

/msg chanserv REGISTER #agaric secretpass AgaricDesignCollectiveChatRoom

And got this:

Lighter weight biblio_load_contributors

Somehow I wrote the explanatory text for the function twice. It seems far too much for a small function so we're pulling out the philosophy and putting it here, for now.

Debugging errors in Drupal or anything running on Apache

Had occasion to do a quick (read: emergency) debug session for a live site today, and as I remembered the steps for a change, wandering around on a server not our own, I share with them with the world repackaged as a debugging lesson:

Change the default application for editing files in Mac OS X

Select a file of the type you want to set a new default application for opening.
Press Command i or select Get Info from the File menu.
Under "Open with" select the application and press Change All.

Resolution

Drupal database layer (up to the D6 era) and limit clauses: use db_query_range()

Variables passed in first, and then a start and as stop value for indexing (zero and ten, here).

<?php
$result = db_query_range(db_rewrite_sql($sql), $type, $status, 0, 10);
?>

An example from node module's search integration, node_update_index(), makes it clearer:

<?php
 $limit = (int)variable_get('search_cron_limit', 100);

  // ...

Highlight search words in Drupal autocomplete results

We've done this for SCF in the biblioreference module. Not the cleanest or most universal, but our autocomplete was messy and it's easy to make your own autocomplete function.

Here's the code and a lot of it surrounding it. The biblioreference_match_nodes function immediately below calls the biblioreference_autocomplete_highlight several times, each time before putting any HTML spans around the text, so we don't insert strong highlighting tags into our own markup.

Ask Agaric: Where does Drupal store module dependency information?

"I can't see how drupal is storing the dependents. They are not in the system table info column."

Drupal doesn't store dependents, it gets them from the .info file each time:

COINS feature in Biblio stores the site URL

Kathleen noted that the biblio_coins column was the only place in an entire site database that was storing the site URL, which is annoying when building out and adding content to a site at a URL that is not its final location.

Biblio is doing this as part of its automatic (and to my knowledge unheralded) feature of adding hidden "COINS" data to its output of bibliography entries everywhere, it seems, even the shortest listings.

Syndicate content