August 2007
5 posts
Yeah, I did this twice: common form API errors.
Error on line 208 of form.inc? … Or maybe something like this (line numbers may vary)?: * warning: Illegal offset type in /var/www/development/drupal/includes/form.inc on line 208. * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Array' was given in /var/www/development/drupal/includes/form.inc on line 219. ...
Aug 1st
July 2007
4 posts
ME SO AJAXY: Getting the current path/URL in...
$current_path= drupal_get_normal_path($_GET['q']); That wasn’t terrible, was it? If you’re using an alias, this won’t necessarily get you a ‘matching’ pathname, but for an AJAX query that calls a URL the user probably isn’t gonna see anyways, it looks like it’ll work nicely. * If you’re wondering why I think I need this: I’m making some...
Jul 31st
Half-assed Regex: splitting a sentence at the...
“Can we just grab the first sentence of the body and use that?”, is something often asked of me. While I hate pretending that the first sentence is always going to be a good lede (because half the time, it’s not), until someone comes up with a good auto-summarizer (hey, Columbia! Open source that code you’ve been hiding!), I’m left tossing in this php regex...
Jul 26th
user hook gotcha: module_invoke_all shortcomings...
Over the last few days I’ve been working on a module that will allow user-controlled profile views. In other words, users will be able to manage what is displayed (and to whom) when someone clicks through to their user page. In the process, I’ve run into a number of supremely fun Drupal adventures, many of which have ended with me breaking pens or using all my strength to angrily crush...
Jul 11th