User login

note

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

Manually replace the body of an Activitystream node

Manually updated twitter feed post:
http://anjaliforberpratt.com/node/1270/edit

after that they should properly have the twitter name in the title, but not in the body.

and by manually updated, i mean activitystream breaks the bloody node edit form somehow.

Since i only want to do D7 development, and this is D6, i bailed pretty early and made the change direct in the live database (after careful investigation of course).

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

Check if a given uid has a given permission (a query to avoid user_load)

a good D7 query for determining if a user has a specific permission
via agentrickard

what's wrong with user_access('permission', $account) ?

it requires a user_load_multiple() (a user_load to get the roles on the account, turning in the ID is not enough)

which is wasteful if you can do it at the query level

you could see what queries that function runs

it seems like that is a somewhat complicated thing to work out
since users can belong to many roles

how many users is this for at a time? I'd just use user_load() + user_access().

committing a project to gitorious

[cut from DGD7 since git.drupal.org came around in time]

Tip The public key for a user on our UNIX-like computer or virtual machine can usually be found in a file located in our user's .ssh folder in a file named id_rsa.pub (less ~/.ssh/id_rsa.pub), or by creating a public-private key pair if necessary (ssh-keygen).

cd remarkup
git checkout master
git remote add origin git@gitorious.org:remarkup/remarkup.git
git push origin master

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.

Staying Free: Contributing to Drupal and the World by Building Our Collaboration Infrastructure

Talk Description: *
[The talk will cover the concepts of the below, but shorter and better and more specific where it matters and the presenter will be better looking than and more articulate than i am in reality, too.]

Our software is free.

We are free.

Both are in part because we are craftspeople who can be compensated quite well. We have remarkable control over our work, and we have time to put into building Free Software and the community around it.

This fortune and freedom is historically crushed out of every trade.

Syndicate content