User login

Science Collaboration Framework

Restore locally deleted files with git

In SVN, running svn update will restore any files you have deleted locally where you have not explicitly committed the removal. Not so in git (or at least git-svn) for removed or moved files.

The tip found will restore not just one, but every deleted file. Agaric recommends you check what you're restoring with just git ls-files -d (where -d stands for --delete) first.

git ls-files -d | xargs git checkout --

TinyMCE, iFrames, JQuery and Drupal scattered notes

Drag and drop into the TinyMCE textarea triggers onEvent twice in such close succession that it creates a race condition, and the same values for the length of the textarea before and after are given.

Getting around this by putting the character change check new value set before running the code. Maybe a timer check, or ideally a way to check the textarea with just a timer and not use onEvent at all, would be best.

Testing assisting module: set configurations through site's URL

RoboConf
module
http://drupal.org/project/roboconf

commissioned by Top Notch Themes
test their themes
only way they could do this with a 2-3 person company

security nightmare, should never go anywhere near a production site

in the URL, you give it parameters - logged in, logged out, blocks

RoboConf will configure your site to the setup of the url

view your site in different browsers

using pre-generated URLs

Vocabulary Per User, New Taxonomy Module in the works by George Cassie

every user has their own vocabulary

so you can show, but disabled-- see what everyone else has been tagging a node with

http://castlin.net/blog/1/2009/03/vocabulary-user

Resolution

Convert Workflow's radio buttons to submit buttons in Drupal 6

Overview

When really messing with how a node and all the modules acting on it submit data when saving a node, you need to tackle things from both the form_alter side and the nodeapi side (or otherwise mess with the node submission).

Workflow uses nodeapi, and the only thing it's really looking for when inserting or updating a node is $node->workflow. We can set this in hook_nodeapi, most sensibly in op presave, or we can do it the probably harder but more correct-seeming way of an extra submit function. Detailed eventually below.

Get rid of extra spaces using PHP's preg_replace

Right there in the examples for the php function preg_replace was how to strip whitespace from a string:

<?php
$str = preg_replace('/\s\s+/', ' ', $str);
?>

Ereg replace looks prettier:

<?php
$string = trim(ereg_replace(' +', ' ', $string));
?>

However, Agaric has read in several places that preg_replace tends to be faster.

Resolution

Maintaining referential integrity with Drupal CCK nodereference

Problem: Drupal does not check to make sure a node isn't being used as a nodereference on another node before it is deleted.

Solution: Agaric's own Stefan Freudenberg has created a module to protect from this.

Notes:

Both of these are about the opposite direction:

Syndicate content