Thanks to everyone who contributes!

I believe the module is looking for Views 2 api. Can anyone confirm this? I don't think there is a Views 2 for Drupal 7. We may need to review all the code that builds and accesses views. This could be the cause of numerous errors that seem to be floating around.

Line 72:
function uc_node_checkout_views_api() {
return array(
'api' => 2,
...

Line 594:
$version = (int) views_api_version();
if ($version === 2) {
...

Line 1087:
$version = (int) views_api_version();
if ($version === 2) {
...

Thanks!

Comments

mr.andrey’s picture

subscribing...

mr.andrey’s picture

Actually, I don't think this works with Views 3 at all.

Please correct me if I'm wrong in my steps to replicate the problem:

Create a view: ordered products
Add relationship: UC Node Checkout Node
Add a field from the created checkout node with relationship "UC Node Checkout Node".

The field comes up blank.

I also tried to do the reverse:
Create a view: Content
Add a relationshop: UC Node Checkout Ordered Product
Add a field like Order Status with Ordered Product as the relationship.

Comes up blank.

It appears that there is no Views 3 integration.

Andrey.

yaworsk’s picture

@schmook, You're right that uc_node_checkout_views_api should return api 3. The lines you are referencing accommodate views 2 and 3, that's why they are in an if statement. However, at this point, I would think everyone should be on views 3 now and the if statement can be removed.

@mr.andrey, with regards to whether there is views 3 integration, there is. This views inc file with this module establishes relationships. However, the dev version doesn't seem to be saving the node id and product id in the table uc_node_checkout_order_products which is what is being linked with views.

This is related to another issue -http://drupal.org/node/1696914 - which i created a patch for http://drupal.org/node/1696914#comment-7296120. Apply that and the table will be properly updated. Then just update update uc_node_checkout_views_api with api 3 and you should be able to create views using uc_node_checkout info.

pete

ps, you can now use the follow button at the top of issues / comments to follow rather than leaving a subscribe comment...