Views: How filter Org Grps to only incl. current Group

I am using Organic Groups.

A user can be a member of multiple groups but can only work in the context of a single group at a time.

To this end, I have created a Field = Current_Group in User table (I know should not add to core tables, but found no way to get to these fields efficiently if in another table and can't do PHP).

How do I use this in a filter to limit views for that user to that single current group for that user?

In particular, how does this work for views that use aggregation?

Thanks for any suggestions.

Aggregate and Compress CSS Files Break Webfonts

I have a few webfonts installed and working correctly using a separate CSS file. When I choose Aggregate and Compress CSS Files in performance, the webfonts stop working. They no longer load and the page reverts to using a default font.

Any clue?

Creating relation types programmatically

Assisted programmatic creation

If CTools is present, an export link is provided for each relation type you have created. The export creates an object $relation_type and relation_type_create($relation_type); plus relation_type_save($relation_type); will make a relation type out of that object. The function to do so would look like this:

* Create the relation type for books <=> collection.
function example_loan_create_relation_type_borrow() {
$relation_type = new stdClass();
$relation_type->disabled = FALSE; /* Edit this to true to make a default relation_type disabled initially */
$relation_type->api_version = 1;
$relation_type->relation_type = 'example_loan_relationship_type_borrow';
$relation_type->label = 'borrows';
$relation_type->reverse_label = 'is loaned to';
$relation_type->directional = 1;
$relation_type->transitive = 0;
$relation_type->r_unique = 1;
$relation_type->min_arity = 2;
$relation_type->max_arity = 2;
$relation_type->source_bundles = array(
0 => 'user:*',
$relation_type->target_bundles = array(
0 => 'node:libcat_book',
// Relation type create adds default keys. It also handles casting to array.
$relation_type = relation_type_create($relation_type);
// Yes, in relation.module 'save' is a distinct step from 'create'.

SQL in Text Fields or Textareas

I have a site where I am recording several of my coding functions and some coding tricks that I have learned through my travels. I save these things for future reference for myself and as tutorials for others.

However, when I submit SQL type code into Drupal's textarea or text field, all I get is a blank "Add Content" form.

Now I know servers have several "plugins" that may be preventing this, so I disabled PHP_SAFE_MODE and Mod_Security on my server.

I tried to add new content again... again it fails and I am left at an empty "Add Content" form.

I have determined the text within my tutorial that is causing this to fail is:

UPDATE table1 SET changelog = CONCAT(changelog, "new data") WHERE id = 'idnumber';

I have tried to enter this code segment on my current drupal 7.x install, on a fresh drupal 7.x install, and on a fresh drupal 6.x install. It fails everytime.

To make sure it was a drupal issue, I created a form outside of drupal and was able to successfully submit the code. Therefore, I know it is not being filtered out by any of my server's "plugins".

Does anyone know what I can do? Could someone verify this is drupal preventing me from submitting this and not a server config?

Many thanks for any help!


Change Reply Content type.

Currently, my comments have multiple text fields as well as radio buttons. Is there a way to have the reply button to bring a form with only a single text field. Basically, I want replys to have a different content type from the comments. Is that possible?

Thank you in advanced!

Redirects of files not working

I am trying to use blubrry to help track my downloads of my podcasts, and so far as I can tell this SHOULD work, but it isn't...


Subscribe with RSS Subscribe to RSS - Drupal 7.x