User login

Drupal

Aphorisms of API Design

by Larry Garfield (crell)

http://chicago2011.drupal.org/sessions/aphorisms-api-design

Application Programming Interface
code for which the intended user is ... more code.

aphorism: subjective truth or observation

not fixed rules. guidelines

Garfield's Law:
One is a special case of many.

If view Row style isn't visible, change the style to one that allows both

When editing a view, the Row style option may not be available. Change the Style to one that is available to all (both) row styles, such as Unformatted, and you will be able to change from Row style Fields to Row style Node.

The row type of node is not available when the grid style is in use, for instance.

Field labels should be number of items / plural aware

Ideal would be on the field settings, or possibly the field display settings, you can set what the singular and what the plural should be.

I don't think automatic adding of an s would work so well.

Point is you have a link field for entering web sites, it should say web site if there is one and web sites if there are multiple.

The saga of changing a value of a field via a preprocess function, played out on IRC

(Courtesy the Completing a Site (the Other 90%) chapter of Definitive Guide to Drupal 7.)

The short

You can change the value of a field in a preprocess function here:

<?php
$vars['items'][0]['#markup']
?>

Nowhere else!

The long, unnecessary story of figuring this out

Functions investigated:

Password accepted, redirected to user page, but access denied-- login succeeds but fails by the time of redirect

login seems successuful but drupal site redirecting to user page access denied error

http://drupal.org/node/824548#comment-3125358

it was due to having cookie domain set (albeit apparently correctly) in my local settings.php

commenting it out, and i could log in.

Problems upgrading a Drupal site with Webform from 6.x to 7.x (Webform in 7 does not upgrade to 3.x from 2.x)

Short version: Upgrade webform to 3.x first, while still on your Drupal 6 site.

Went back to the database that i swear i dumped right after upgrading. And the system table has version 7.0 core modules in it, so it's not like i accidentally

Use Drush to sync files from one site to another

Believe it or not, this is the function you want:

core-rsync (rsync) Rsync the Drupal tree to/from another server using ssh.

For example:

drush rsync @example.stage:%files @example.local:%files

Can't do remote to remote though.

Enabling and disabling modules based on environment

A drush command. Text file with modules to enable on dev, and then run it manually or somehow automatically.

drush? make text file with all the modules and git it to drush pm_enable

If we have a defined practice for environment-specific module enabling/disabling and i'd love to disable views_ui, update, etc. on live

It would be run after sync commands-- pull data from live, but then enable update on the test site, and all site building modules on dev

Input formats export / import helper

Input formats module - http://drupal.org/project/input_formats - is "an API that allows for the export and import of input formats like an object. This module makes it possible to export and import wysiwyg editor settings into Features."

Seems it should do more than wysiwyg?

See also:

Patch to WYSIWYG module to make it exportable (with help of Entity moduleL.

Syndicate content