User login

WSF2008

Select rows in a MySQL table that have no corresponding rows in another table using IS NULL

If there is no matching row for the right table in the ON or USING part in a LEFT JOIN, a row with all columns set to NULL is used for the right table. You can use this fact to find rows in a table that have no counterpart in another table:

How do I put Drupal's sitewide contact form on any page or panel I want?

Is Drupal's default contact form page a tad too restrictive? Do you want to have more than comfortably fits in the little option to have some text above the contact form? Do you need even that text to be multilingual? Would you rather not try to do all this with form_alter and creative use of blocks? Why can't one simply embed the contact form in a page, or better yet as one element in a panel, you ask? Why, indeed. Agaric has no idea why. But Agaric can tell you how (with or without generous use of text emphasis, we're flexible).

Fastest way to check if anything is in a MySQL table

http://forums.mysql.com/read.php?101,50600,50853#msg-50853

Vail wrote:

> When it checks to see if the
> group exists, however, and the table is empty, it
> always returns an error, which disables the script
> that calls the function.

Why not doing a simple

select count(*) from groups

?

Locale subset module motivation: remove, hide, get rid of non-public UI strings

Background:

http://hojtsy.hu/blog/2007-oct-10/comparison-your-localization-options-drupal-5-and-6

Doing the World Social Forum site right now has brought up two questions for me:

First, is there a way to tell either the translation interface or a PO export to ignore all strings in /admin pages?

Static variables in PHP last for a single execution

what does static caching mean in php?

That a variable is remembered when that instance of PHP next goes into the function holding the variable, and an instance is per-call, per-user, for a single page execution from the standpoint of a web app (simultaneous calls to PHP open different process threads).

static only applies for the life of the process

static variables are used to keep variable content between two function calls, not between two script executions, from what I can see in the manual and from how it behaves in C/++.

Parse syntax error unexpected T_SL caused by Subversion conflict

You caused a conflict in your template.php

so the status on SVN was set to "C"

apparently that means the conflict only exists in that local checkout? Did you edit directly on the server?

Anyway, whatever happened, I do SVN update on my checkout of the repository, look at line 464

as the error message is Parse error: syntax error, unexpected T_SL on line 464

and everything is fine

but if I look at the file directly on the server, even though it is up to date (but giving that C flag)

Increase PHP allowed memory size limits

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 842489 bytes) in /var/www/wsf2008/includes/database.mysql.inc on line 380

If you have control of your own host:

ben@server:~$ sudo vi /etc/php5/apache2/php.ini

/Resource Limits plus RETURN to search
i to edit

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

Copy (or inherit) taxonomy terms from one node to another

function wsf_action_copy_terms($from_nid, $to_nid, $avoid_race = FALSE) {
// agaric-ben @TODO optimize;
// see http://agaricdesign.com/note/copy-taxonomy-terms-from-one-node-another
  if ($avoid_race) {
    // avoid pseudo race condition from taxonomy_node_get_terms static variable

White Screen of Death due to taxonomy parent-child infinite loop

The site stopped showing. Nothing.

What I should have done first:

tail -f /var/log/apache2/error.log

0 stedile:~# apache2ctl restart

0 stedile:~# /etc/init.d/mysql restart

Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . ..
Checking for corrupt, not cleanly closed and upgrade needing tables..

0 stedile:~# xm console stedile
-bash: xm: command not found

Setting up a fresh Drupal installation from the Agaric repository.

For a new version of Drupal

From a computer with a local checkout of the subversion repository:

cd ~/workspace/repos/agaric/drupal-core/
wget http://ftp.drupal.org/files/projects/drupal-5.5.tar.gz
tar -xzf drupal-5.5.tar.gz
rm drupal-5.5.tar.gz
svn add drupal-5.5
svn commit -m "latest and greatest Drupal"

Syndicate content