I noticed this when using addressbook with Commerce 1.9 and dev. Here is probably the best way to reproduce this:

1) Make a user role that has edit/view own and create shipping and billing
2) Install addressbook
3) Have the user make two billing profiles (one will become default)

You will see that the non-default one does not show in the second addressbook view on the addressbook tab.

For whatever reasons, Views is doing this join pattern:

commerce_customer_profile -> LEFT JOIN -> commerce_addressbook_defaults -> INNER -> commerce_customer_profile

commerce_entity_access_query_alter is choosing the second commerce_customer_profile table as the alias for "base_table". Thus for any rows where the first LEFT JOIN found no key in commerce_addressbook_defaults, the ownership conditions that commerce_entity_access_query_alter puts in will cause the row to get left out.

I have attached a patch to fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
Priority: Major » Normal
Issue tags: +sprint
rszrama’s picture

Status: Active » Needs review

Just a quick note: we've had a release of the Addressbook module since this issue was reported, so if you can't reproduce the issue with the latest version, consider testing with a prior version.

lisastreeter’s picture

Status: Needs review » Closed (cannot reproduce)

Using the latest version of commerce_addressbook, I could not reproduce the bug.

I then tested with the version active at the time this issue was created: 7.x-2.0-rc7, dated 5/19/2013 and was able to reproduce the bug exactly as described.

Since this bug no longer exists with the latest release of commerce_addressbook, it can be closed.