Download & Extend

Programming addition to Views help

Project:Views
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

The example on this Handbook page http://drupal.org/node/342132 (Get the result a view creates) looks like a good one for the API section of Views documentation.

Suggest adding it to the Advanced Help inside Views, and then archiving the Handbook page when this has been done.

Comments

#1

Status:active» needs review

Why not even bring this into the views module? I guess its often used

AttachmentSizeStatusTest resultOperations
views-get-view-result.patch1.81 KBIgnored: Check issue status.NoneNone

#2

Title:Programming addition to Views help» Archive this handbook page: Programming addition to Views help
Project:Views» Documentation
Version:6.x-2.x-dev» <none>
Component:Documentation» Outdated
Category:feature request» task
Status:needs review» active

Ok, committed to Views and moved to Documentation queue to handle archiving or editing the old documentation. It may still be valuable as an example of how to manipulate a view even with that function available in Views.

#3

Status:active» fixed

Thanks. The old doc page has been archived.

#4

Project:Documentation» Views
Version:<none>» 6.x-2.x-dev
Component:Outdated» Code
Status:fixed» needs review

I've modified the patch to improve DX :
- Changed the function signature to include args = array() .
- Removed some unneeded code fetching arguments.
- Fixed the documentation to comply with Drupal standards.

AttachmentSizeStatusTest resultOperations
495606-views-get-view-result-4.patch2.16 KBIgnored: Check issue status.NoneNone

#5

Note that changing $args to an array makes the signature differ from views_embed_view() -- I'm not sure that's a good thing.

#6

Yes thats exactly what i thought.

views_embed_view('view', 'default', 1, 'type');
views_embed_view('view', 'default', array(1, 'type'));

Decide which is more friendly for the developer :) i think the first one.

#7

Title:Archive this handbook page: Programming addition to Views help» Programming addition to Views help

#8

@dereine,

I think the 2nd option (with the array) is better DX. Just by looking at the function's signature one can know $args can be passed. Currently, they should look into the code and see the func_get_args(), and understand from that they can pass args.

#9

Regardless, consistency with an existing very similar function matters, even if one format may be marginally better. The consistency is more important, and Views is already inconsistent enough, thankyouverymuch =)

#10

Status:needs review» closed (won't fix)

Ok, I agree that consistency wins in this case, so "won't fix".

nobody click here