Domain Access 6.x-2.0 and Views 2
nirvanajyothi - October 11, 2008 - 07:42
| Project: | Domain Access |
| Version: | 6.x-2.0-rc6 |
| Component: | - Domain Views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | nonsie |
| Status: | closed |
Description
Will Domain Access 6.x-2.0 be Views 2 compatible?

#1
I am using Views 2 latest rc and would like to use Domain Views.But it is not possible with DA 6.x-1.2,rite?
#2
The final release will be Views 2 compatible. The current release is not.
Assistance (patches) would be appreciated.
#3
also see http://drupal.org/node/287337#comment-994521
#4
This is now in testing in HEAD. Very unstable.
See also #320257: Move $domain->user data to own table and #320064: Move the default domain into the database which both make Domain Access more 'Views friendly.'
#5
I've started to work on Views 2, at the moment there's no support for anything "current" (similar to current user's default language for node->language). I'm not sure what to name these filters, any help would be appreciated.
#6
@nonsie
How is that relevant to DA? And are you working along with the code in HEAD or doing something else?
#7
I checked out the code from HEAD based on #4.
Let me rephrase my question - at the moment domain_id filter is a numeric field while old DA Views allowed user's to choose one or more specific domains or current domain (dynamic value based on the domain the view is rendered on). What I'm most interested in is being able to filter nodes that are published to:
1. current domain
2. current domain or all affiliates
3. any domain
Views used to have node translation in node group, now it has been moved to a separate group called node translation. Should DA use a different grouping for filters/fields dealing with dynamic values (current domain, current user's domain etc)?
For my own purposes I could create it any way I could possibly come up with but I'd rather write something everyone can use.
#8
Those are the questions where I stopped, since Views uses OO code for custom handlers now, and I have to learn how to make that work correctly.
My suggestion is to submit patches that get the functionality that you are after. Then I/we will standardize and generalize them for release.
#9
Added currently active domain and any domain to domain_id and gid filters. Also added an additional filter for content available on currently active domain (either published to the domain or all affiliates).
Still no support for arguments.
Edit: for some reason include files were left out
#10
#11
OK. Patch applies and things seem to work. I have not tested heavily but will commit and release rc5 so we can get more feedback.
#12
Could you update Domain Views description on the project page? rc5 is compatible with Views 6.x.2.0.
#13
Done.
#14
I can confirm that the "in current domain" filter at least appears to work in RC5. I've not tested the other bits yet.
#15
Still more to be done here....
#16
A patch which removes the extraneous filter by null (not needed in Views 2) and adds stub support for {domain_editor}.
#17
Domain and Domain ID arguments are missing in Views 2.
It would be great to have these back when you guys have the chance. Thanks.
#18
is this patch applied to rc6?
#19
That latest patch is against HEAD, but should apply to rc6.
#20
Patch from #16 plus:
- argument handling
- output sitename field as single or multiple values (see #405084: "Publish to" as a field in Views). Similar approach should probably also exist for all other fields. Optionally link this output to the node on default domain or the domain the node is published to).
I am not sure if the approach to handle multiple values is indeed the correct way of doing this. I've based my code on taxonomy multiple term handling and CCK views support.
#21
#22
Small note -- the patch file had Windows line breaks. It still applied, but this is something we will have to watch carefully.
Attached is a reformatted version of the patch -- no changes, just the creation of the new files inside the 'includes' directory where they belong, and with Unix linebreaks.
Nothing seems to be broken by the patch, but I have not had a chance to review thoroughly.
#23
hook_theme() requires that you list the file where the theme function resides if it is not in the same file as the hook. We might as well put that one theme function directly in the module file.
http://api.drupal.org/api/function/hook_theme
#24
Clears up some confusion by changing group names. Needs some documentation.
I say commit and move on. Let people test.
#25
This last patch has been committed to HEAD. More work still, but this is much improved!
#26
Here is a patch that adds Domain Source support, and allows domain_id fields to be output as links.
#27
Revised to remove the old 'Any domain' option.
#28
Revised version of the patch. Simpler. Maybe better?
#29
I couldn't get the patch doesn't apply against rc6. At least, all of it applies except for the last change to domain_views.views.inc to function domain_views_views_handlers()
patching file domain_source/domain_source.moduleHunk #1 succeeded at 193 (offset -8 lines).
patching file domain_source/domain_source.views.inc
patching file domain_views/domain_views.views.inc
Hunk #2 succeeded at 148 with fuzz 1 (offset -1 lines).
Hunk #3 succeeded at 165 with fuzz 1 (offset -58 lines).
Hunk #4 FAILED at 212.
1 out of 4 hunks FAILED -- saving rejects to file domain_views/domain_views.views.inc.rej
patching file domain_views/includes/domain_views_handler_field_domain_id.inc
patching file domain_views/includes/domain_views_handler_filter_domain_domain_id.inc
Hunk #1 succeeded at 13 (offset -2 lines).
Hunk #2 succeeded at 21 (offset -2 lines).
The contents of domain_views/domain_views.views.inc.rej are
****************** 209,214 ****
'parent' => 'views_handler_argument',
),
// field handlers
'domain_views_handler_field_domain_sitename' => array(
'parent' => 'views_handler_field',
),
--- 212,220 ----
'parent' => 'views_handler_argument',
),
// field handlers
+ 'domain_views_handler_field_domain_id' => array(
+ 'parent' => 'views_handler_field',
+ ),
'domain_views_handler_field_domain_sitename' => array(
'parent' => 'views_handler_field',
),
#30
It is a patch against HEAD.
#31
Fair enough - thought I could apply it because in #19 you said it should apply against rc6 too.
#32
That only applied to the earlier (pre #19 patch)
#33
Patch in #28 committed to HEAD.
#34
Patch from # seems to work as expected.
#35
@agentrickard and @nonsie
I don't know if you can help me out on this. I have installed the domain module and domain block module, but It seems the domain module does not work well with views on my drupal installation. My problem is that, when I administer my content with views(with a block display), I dont seem to see the views(which has a block entry on the block page) displayed on my page. But when I create content and is promoted to front page plus including domain specific display of the content, It works fine.
Is it that domain module does not work with views or what? It also seems to me that the domain module does not work with the panel module. What I did is that I added to a mini panel the content of the views which was created earlier. And when assigned to a block region, nothing is displayed.
Please I need urgent help on this. My deadline is Friday. Please @agentrickard and @nonsie
#36
@drecute
You need to open a new issue and give more details. DA works fine with both Views 2 and Panels 2.
Nesting content (a view inside a panel inside a block) may not work as expected, especially if the content is not visible on the current domain.
#37
@agentrickard
Thanks for the response.
I have opened a new issue at http://drupal.org/node/461576. Please kindly look through. Thanks.
#38
subscribing.
#39
I'm going to close this one and deal with other issues separately.