User login

Drupal Development

Creating a word paste plugin for TinyMCE

Ebony-II:tinymce ben$ grep -nHR 'mceCleanup' . | less -S

Debug a somethnig going weird in someone elses nodeapi presave

This could be prettier. Do not judge. Especially could be prettier using an IDE.

Bringing SVN to a particular revision; useful with DBScripts

Checkout into a new directory:

svn checkout -r 1310 http://svn.repositoryurl.example.com/path/to/repos newlocalfolder
# Checks out a new working copy at r1310

Or update a working copy to a given revision number:

cd local-folder-for-repo
svn update -r 1310
# Updates an existing working copy to r1310

(Note: You cannot make changes and commit from an old checkout like these.)

Enter the Unholy: Microsoft Word to the Web

Summary of the issue below, and then the beginnings of a search for a solution.

Currently TinyMCE with the WYSIWYG API is in use.

Problems with the wysywg editor, which is a life or death issue for the site.

Problem 1: gibberish code inserted after cut and paste from Word
Problem 2: arbitrary line breaks inserted into text – they are invisible in the editor, visible in preview and in publish, but are not at all fixable by using the editor.

Using Git submodules to share modified Drupal modules across sites

This reference is currently somewhat specific to Agaric's setup. We currently use Drush to update modules rapidly on a per-site basis (rather than updating a module in a central location and pushing it to the sites that use it), but certain modules have special needs (extra files, a patch that needs to be applied and hasn't been committed to Drupal.org version control yet) and when these modules have to be used on multiple sites, we can save time by bringing them in as submodules. Here are the notes from the first time we did this.

Having your Git and your SVN too

Via Stefan:

Kathleen wrote an email with the three commands you need.
git-svn fetch -s svn_repo
first it's git-svn clone -s ...
you can update it with git-svn fetch
and with git-svn rebase you can merge svn updates to your git workdir
and git-svn dcommit commits to subversion

Resolution

Form altering certain CCK widget properties is tricky: adding and changing the size of an autocomplete textfield

This code (which is not called automatically but is a helper function for our hook_form_alter implementation) adds the suffix but does not change the forms size. Somehow these widget settings must get added later.

Does FeedAPI re-import a feed item if its node has been deleted?

We thought feeds would just import back news feed items after deletion, thus the need for feed moderation, but when testing it looks like it actually keeps track of deleted feed items somewhere.

Don't see any special table for this to be stored in, though.

Hmmm.. it doesn't delete anything from the feedapi_node_item table using hook-nodeapi on node delete, but it is deleting deleted feed item nodes' urls from this table nonetheless.

Resolution

Lighter weight biblio_load_contributors

Somehow I wrote the explanatory text for the function twice. It seems far too much for a small function so we're pulling out the philosophy and putting it here, for now.

Debugging errors in Drupal or anything running on Apache

Had occasion to do a quick (read: emergency) debug session for a live site today, and as I remembered the steps for a change, wandering around on a server not our own, I share with them with the world repackaged as a debugging lesson:

Syndicate content