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.

Files: 
CommentFileSizeAuthor
#6 uc_addresses6-views-actions-links-1900176-6.patch16.35 KBMegaChriz
PASSED: [[SimpleTest]]: [MySQL] 2,801 pass(es).
[ View ]
#4 uc_addresses7-views-actions-links-1900176-4.patch19.95 KBMegaChriz
PASSED: [[SimpleTest]]: [MySQL] 3,357 pass(es).
[ View ]
#3 uc_addresses-views-actions-links-1900176-3.patch6.03 KBMegaChriz
PASSED: [[SimpleTest]]: [MySQL] 3,144 pass(es).
[ View ]
#1 uc_addresses-views-actions-links-1900176-1.patch6.12 KBMegaChriz
PASSED: [[SimpleTest]]: [MySQL] 2,682 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new6.12 KB
PASSED: [[SimpleTest]]: [MySQL] 2,682 pass(es).
[ View ]

This 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.

Issue tags:+Needs tests

StatusFileSize
new6.03 KB
PASSED: [[SimpleTest]]: [MySQL] 3,144 pass(es).
[ View ]

Rerolled the patch in #1.

StatusFileSize
new19.95 KB
PASSED: [[SimpleTest]]: [MySQL] 3,357 pass(es).
[ View ]

Now with automated tests.

Version:7.x-1.x-dev» 6.x-2.x-dev
Status:Needs review» Patch (to be ported)

Committed #4 with two small changes in the automated test:

  1. The address book cache of each user in the test is cleared, to be sure no addresses from previous tests are still in there.
  2. Code comments.

Needs porting to 6.x-2.x.

Status:Patch (to be ported)» Needs review
StatusFileSize
new16.35 KB
PASSED: [[SimpleTest]]: [MySQL] 2,801 pass(es).
[ View ]

Patch for the 6.x-2.x version. Tested with both Views 6.x-2.x and Views 6.x-3.x.

Version:6.x-2.x-dev» 7.x-1.x-dev
Status:Needs review» Fixed

Committed #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.

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