This is a subissue of #1391216: Views integration for the 6.x-2.x and 7.x-1.x version
Problem/Motivation
When displaying a list of addresses with Views using fields, it would be nice to be able to add view, edit and delete links to the View. Of course, these links should only be shown if the action is permitted by the current user.
Proposed resolution
Implement three Views fields, each with its own handler. Each handler should check with the permissions class (UcAddressesPermissions) if it should display the action link.
Remaining tasks
- Implement the three link fields.
User interface changes
None directly, but site builders will get an option in Views to add specific actions links as fields.
API changes
None.
A patch will follow.
Comments
Comment #1
MegaChriz CreditAttribution: MegaChriz commentedThis patch adds Views fields for view, edit and delete links by extending the Views handler "views_handler_field_entity". It depends on a patch from #1831424: Turn Ubercart Addresses address into an entity, as entity API functions are used in the implementation.
This could use some tests.
Comment #2
MegaChriz CreditAttribution: MegaChriz commentedComment #3
MegaChriz CreditAttribution: MegaChriz commentedRerolled the patch in #1.
Comment #4
MegaChriz CreditAttribution: MegaChriz commentedNow with automated tests.
Comment #5
MegaChriz CreditAttribution: MegaChriz commentedCommitted #4 with two small changes in the automated test:
Needs porting to 6.x-2.x.
Comment #6
MegaChriz CreditAttribution: MegaChriz commentedPatch for the 6.x-2.x version. Tested with both Views 6.x-2.x and Views 6.x-3.x.
Comment #7
MegaChriz CreditAttribution: MegaChriz commentedCommitted #6 with a small difference: for edit and delete links I had forgotten to add
drupal_get_destination()
to the end of the link.Setting issue back to the version it was originally reported for and mark it as fixed.