Improved views field handler for Sitename

voxpelli - September 18, 2009 - 14:50
Project:Domain Access
Version:6.x-2.0-rc9
Component:- Domain Views
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I wanted to make a views list of active domains and list them in a list linking to each domain's front page - I thought the current field handler would be able to do that, but unfortunately it wasn't so I modified it to be able to that.

I also fixed some of the options to not always expect to have a node available when making a link - that sometimes caused an error and sometimes just caused an unexpected url to be created.

This new field will also have some performance gains when determining the domain scheme and subdomain for some of the settings in the field.

I'm attaching a patch.

AttachmentSize
domain_access_improved_sitename_views_field.patch2.68 KB

#1

agentrickard - November 1, 2009 - 17:44
Status:needs review» fixed

Thanks for the eyeballs on this dark corner of the code!

This patch actually did some things that are totally unnecessary.

Since we use domain_lookup() before writing the path, we have access to $domain['path'], which is the scheme://domain/base_path/ already. The original code didn't use this, nor did the patch.

I am not certain of the array check on values['nid'], because it doesn't take into account field aliasing. Attached is a more verbose patch that handles the node lookups more correctly.

The patch also denies the use of "List all domains this node is published to" unless the base table is 'node.'

Committed to HEAD.

AttachmentSize
581382-sitename-views.patch 6.18 KB

#2

System Message - November 15, 2009 - 17:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.