User login

Drupal Development

Ask Agaric: Max Allowed Packet error

Also do you know about this error?

User warning: Got a packet bigger than 'max_allowed_packet' bytes query: UPDATE cache_form SET data = 'a:56:{

I haven't seen it on example.com, I've seen it on other sites. I started one of the longest issues in the drupal issue queue from that error! http://drupal.org/node/121390

But as neither CCK nor Views are in use with the present example.com demo site, that must be something different!

Switch users in Drupal without logging out for development

Ways to switch users in a Drupal site without logging out:

http://drupal.org/project/masquerade

http://drupal.org/project/impersonate

From code, not for development:
Safely Impersonating Another User
http://drupal.org/node/218104

Resolution

Open external URLs in a new window

Personally and professionally I think links should open in the same tab, but some clients insist on opening external links in new tabs.

Unsupported operand types in messaging module (fatal error on admin page)

On going to any edit a content type page

http://dev.example.com/admin/content/types/promo-badge

Fatal error: Unsupported operand types in /var/www/vhosts/dev.example.com/httpdocs/sites/all/modules/messaging/messaging.module on line 982

Which is the second-to-last line of this function of the messaging.module:

Search PDF attachments on a Drupal site

There's A Module For That!TM

Way back like 3 Boston drupal meetups ago, moshe mentioned a module that would scrape thru PDF attachments and allow drupal to search them...

Got any idea what that module is called?

Found it? Maybe here?

http://groups.drupal.org/pdf

Ahh, found it direct-- here:

Cannot use string offset as an array problem caused by not using curly brace brackets around variable

Why this weirdness?

cannot use string offset as array
Fatal error: Cannot use string offset as an array in /sites/jonassoftware/www/sites/all/modules/field_placement/field_placement.module on line 706

.htaccess workaround for local development, files not in web root

Another reason for setting up your local dev environment with "domain names" on localhost.

(I think this was the error)
Not Found

The requested URL /index.php was not found on this server.

(anyhow, this is the solution)

http://localhost/example/www/node/7
(did not work-- home page did though?)

(Not the problem)

Gathering the data needed to abuse field formatters-- disable and combine and change per node settings set by user

For old times sake... this is one of the last outputs like this before I use a properly integrated development environment, Eclipse PDT (for PHP) with xdebug, which will show all the variables without the Drupal set messaging and such.

Field_placement displaying using CCK field formatters

This is the point where after more blocks and bloopers than I care to admit that we should finally have all the data we need.

Before I try to output any of it though.

The below function produces the below drupal_set_message (dsm using devel) output:

Fastest way to get just one result from a database table in Drupal

To get a single value result – one row from a just one column – the Drupal function for that is db_result(), which takes the result of db_query() as an argument.

http://api.drupal.org/api/function/db_result/5

(The same function works for Drupals 4.7 and 6.)

Get the path to a Drupal module or theme

This is a very useful function in Drupal's API that is hard to find searching online for file system paths to Drupal modules or themes or anything like that.

So to get the path to a Drupal module or theme it's as simple as:

<?php
  drupal_get_path('module', $module_name);
?>

or:

<?php
  drupal_get_path('theme', $theme_name);
?>

Syndicate content