User login

Science Collaboration Framework

Drupal 7's jobqueue doesn't guarantee your hard drive won't be hit by a meteor

Meteor safety is surely the most important metric in open source free software, and we must warn you: Drupal 7's new Jobqueue doesn't guarantee your hard drive won't be hit by a meteor.

This has been a public service announcement from Agaric Design Collective. Good day.

Get the lesser of two or more values with PHP

I love it when PHP has the logically named function. To get the lowest of two or more variables, min($var1, $var2)

Resolution

Patterns

Patterns module
Creating or Writing Patterns documentation

The more modules that allow exportable configuration for use like this, the better, and the easier it will be to use DBScripts to do the rest.

Resolution

Curses: array_merge_recursive doesn't behave as hoped, it creates arrays for matching strings

The PHP function http://us3.php.net/array_merge_recursive doesn't do what I'd hoped. Instead of merely combining nested arrays if it finds them, it creates arrays for values with matching strings.

In the output below uid and biblio_type should be a single, the last-added, value, not an array of a couple values.

Agaric wants CCK Field Permissions to have smarter defaults (let the world see!)

Enabling CCK Field Permissions (cck_field_perms in Drupal 5, part of CCK itself in Drupal 6) can create bugs on your if you aren't paying attention and cleaning up after it.

Some excerpts from IRC among people trying to figure out why an image on a news post simply wasn't showing up (for the user who posted it in this case, the authenticated role had editing but not viewing rights for the imagefield!).

Find out what sites directory Drupal is currently using

The answer is conf_path().

The backstory is we are making a new 'modules', 'themes', or 'files' level folder inside sites/whatever: 'config', to store configuration settings in files.

This would be the ultimate way to get a listing of all ini files in modules, and could do the same thing for 'config' -- this grabs from the currently in use sites directory (such as sites/default) as well as sites/all, profiles, and the built-in modules directory:

drupal_system_listing('.ini$', 'modules', 'name', 0);

Deploying with DBScripts

Make sure you are on your master branch:
cd /path/to/project/root
git checkout master

Update your own version. Try to do it at a time when no one else will be committing. (You can check that you don't have any committed but not pushed changes with gitk &.)

./scripts/fetch_rebase
[This script combines the commands git-svn fetch and git-svn rebase for convenience.]

Get the directory name from a file path string in PHP

There is a built-in PHP function to get the directory portion of a file path from a string (lopping off the filename itself).

http://us3.php.net/dirname

Resolution

Syndicate content