Download & Extend

Views argument default for current domain's id

Project:Domain Access
Version:6.x-2.0-rc9
Component:- Domain Views
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Here's a patch that adds an argument default for the current domain's id in a view.

AttachmentSize
domain_access_views_argument_default_current.patch1.43 KB

Comments

#1

We already have this as a filter. Why would you need it as an argument? Since arguments are passed in from the URL string, and you ignore that, what purpose does this serve?

#2

As a default value for arguments it's decoupled from the actual argument making it possible to use with all argument handlers - both any implemented by Domain Access but most interestingly any implemented by a third party module.

Argument defaults are useful in blocks and embedded views as well as for real pages and in this case it is useful to list all kinds of Views supported data connected to the current domain in some way which isn't necessarily the domain id column in the domain table.

I myself made this because I wanted to use it with a third party module to list some data related to the current in a block on my page and I thought that it should be Domain Views that implements this and not the third party module who uses it.

#3

Alright then. Thanks!

Still needs some review, though. Maybe a bit of documentation?

#4

Status:needs review» needs work

Patch cannot be applied. Please format your patch according to standards, and from the Domain Access root folder.

http://drupal.org/patch/create

For some reason, I can't get cvs diff to recognize the new file. From looking at the Views API, it looks like you have to provide the form elements in the code.

I really don't follow what this patch is supposed to do or where it might be visible in the UI. Does some other plugin have to reference it for it to be loaded?

AttachmentSize
584428-views-arg.patch 1.07 KB
domain_views_plugin_argument_default_current.inc_.txt 1.38 KB

#5

I've double checked that this patch applies with "patch -p0" - I'm using Git to generate it and without the -p0 it didn't want to apply even though it should. Any suggestions to solve that are welcome - I've generated it as suggested on the book page http://drupal.org/node/551858 and the solution there is also what I've come up with by myself.

This patch adds a default argument that appears in the Views UI when you for an argument choose "Provide default argument" as the "Action to take if argument is not present".

AttachmentSize
domain_access_views_argument_default_current_2.patch 1.38 KB

#6

Status:needs work» fixed

Nice. I must have done something screwy with the naming conventions when trying to manually apply the patch.

Only one change (we already know the include $path), and this is committed to HEAD.

AttachmentSize
584428-domain_access_views_argument_default_current_2.patch 1.34 KB

#7

Status:fixed» closed (fixed)

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

nobody click here