Download & Extend

Expose field-collection operational links in views

Project:Field collection
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

If you configure the field-collection module as a hidden field type, and use views to display the field-collection data. You'll find out that you don't have a way for editing and deleting field-collection data.

So if we expose field-collection "operational links" to views, then we'll be able to display that field in our view. Then the administrative staff can manage the field-collection data. Thoughts?

Comments

#1

Status:active» needs review

First time working with the Views API. :) Suggestions welcomed...

AttachmentSizeStatusTest resultOperations
field_collection_expose_operational_links_to_views_1309332-1.patch4.01 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch field_collection_expose_operational_links_to_views_1309332-1.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#2

Status:needs review» needs work

I think each link should be exposed on its own. Then we should make use of the recently added views_handler_field_entity to ensure we are getting real entity objects.

Also, we might want to look into exposing them automatically with the entity api? For that we would have to improve it to allow modules to specify the edit and delete urls somehow.

#3

Status:needs work» needs review

#1: field_collection_expose_operational_links_to_views_1309332-1.patch queued for re-testing.

#4

Status:needs review» needs work

The last submitted patch, field_collection_expose_operational_links_to_views_1309332-1.patch, failed testing.

#5

Here's a quick and dirty re-roll of #1 that works for me against latest dev.
It would be even awesomer if we could somehow make this work with views' Global: Contextual Links handler.

AttachmentSizeStatusTest resultOperations
field_collection_expose_operational_links_to_views_1309332-1.patch3.02 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch field_collection_expose_operational_links_to_views_1309332-1_0.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#6

Status:needs work» needs review

OK, here's a much better patch, imo

  • implemented "crud info", similar to the discussion going on in entity api:
    #1333870-14: Add links to entity views integration
  • added views handler "field_collection_handler_field_url.inc" that extends "views_handler_field_url"
  • exposed crud fields to views through field_collection_field_views_data()

In conjunction with this patch: #1638074: views_handler_field_url is not compatible with views_handler_field_contextual_links, these urls will work with gracefully with contextual links. (as it stands, they'll still work, but you'll have to play with rewriting the output of the field).

#7

Status:needs review» needs work

The last submitted patch, field_collection_expose_operational_links_to_views_1309332-1.patch, failed testing.

#8

Status:needs work» needs review

... and the patch

AttachmentSizeStatusTest resultOperations
field_collection-view_urls-1309332-5.patch3.73 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch field_collection-view_urls-1309332-5.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#9

Status:needs review» needs work

The last submitted patch, field_collection-view_urls-1309332-5.patch, failed testing.

#10

Status:needs work» needs review

fargle bargle testbot

AttachmentSizeStatusTest resultOperations
field_collection-view_urls-1309332-10.patch3.93 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch field_collection-view_urls-1309332-10.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#11

Status:needs review» needs work

The last submitted patch, field_collection-view_urls-1309332-10.patch, failed testing.

#12

this is a good patch.
i give up.

#13

Status:needs work» needs review

Hi guys!

First of all I want to thank fago for this beautiful module and thank you guys for your patches!
Here is updated patch:

  1. Handler extends new views_handler_field_entity handler as fago proposed.
  2. Added permission checks.
  3. Also I have removed view and add links. I think they are unnecessary here.
AttachmentSizeStatusTest resultOperations
field_collection-views_links-1309332-13.patch5.33 KBIdlePASSED: [[SimpleTest]]: [MySQL] 132 pass(es).View details | Re-test
nobody click here