Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
14 May 2010 at 20:13 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent
Comments
Comment #1
pcambraTaking care of this, from views docs: http://views-help.doc.logrus.com/help/views/api-handlers
Sometimes table and fieldname are not appropriate, but something that resembles what the table/field would be can be used
Comment #2
pcambraGit pull requested in github for this issue (not 100% sure if this is the correct procedure or if I should upload a patch here as well)
One question about views hanlders in commerce_product module, there is one for the link of the product that is not used for display purposes, only for base of the edit/delete handlers, formerly was called views_handler_field_commerce_product_link and now commerce_product_handler_field_product_link.
In commerce_order module a similar handler is used both for display as well as for base.
Comment #3
rszrama commentedHmm, yeah, I think it's b/c when I wrote that integration I wasn't sure we'd have an actual "View" page for products. It makes sense to include, even if the URL will be an admin URL, so I've just recently added the necessary build mode for products (like in the last two days). We'll need to add further integration for products with Views now.
Will pull from you and give it a test drive shortly. : )
Comment #4
rszrama commentedThe pull request worked fine. I pulled your code into my Git repository and tested a fresh install. Everything worked just fine. : )
I think the following things need to be addressed before I mark this fixed:
Since I've pulled from you, I'm not exactly sure how you should resync with my repository. I wonder if you now need to "git pull" from me before you do further work on your end?
Comment #5
pcambra1. Oops, sorry about that, I didn't see them.
2. I was thinking the same as I was changing the names, I tried to respect the views naming, but in some things, like link editing, there is no field, I like the second option too, but what if the module implements a handler for a table which does not have the same name, ie commerce_order_handler_field_other_table_fieldname?
About git, I'm not sure neither, if you didn't push my changes to the online repos, you should still be able to reverse my changes in your repos so I can request another pull and you would download the changes? or maybe I should discard my fork and fork again from your repos?
Comment #6
rszrama commentedHmm, so I pulled from you and then pushed to my repo, and without me having to do anything your commits no longer appear in my fork queue. I suppose that means we're kosher - you can just make further changes to your local repo and send another pull request.
As for the instances of Views integration for modules with multiple tables, I think you're right - several do, and in instances like the Order module we'll have commerce_order and commerce_order_revision. Maybe we can adopt a compromise solution:
I think the full list of handlers would become:
commerce_line_item_handler_argument_line_item_line_item_id.inc
commerce_line_item_handler_field_line_item_line_item_type.inc
commerce_order_handler_field_order.inc
commerce_order_handler_field_order_link.inc
commerce_order_handler_field_order_link_delete.inc
commerce_order_handler_field_order_link_edit.inc
commerce_order_handler_field_order_order_status.inc
commerce_order_handler_argument_order_order_id.inc
commerce_product_handler_field_product.inc
commerce_product_handler_field_product_link.inc
commerce_product_handler_field_product_link_delete.inc
commerce_product_handler_field_product_link_edit.inc
commerce_product_handler_field_product_product_type.inc
If that looks good to you and you have time to make the changes, just send me a pull request on GitHub when it's done. Ohloh's picking up on your commits when I git pull from you. You can claim them as yours if you have an account. It's fun to see more contributors in there. : )
https://www.ohloh.net/p/drupalcommerce/contributors
Comment #7
rszrama commentedI just committed the Views integration for a normal product link field per your suggestion. I also updated the default product View. You'll probably need to pull those commits from my repo before sending a pull request for the handler changes.
Comment #8
pcambraOk, will do that, I'll try to change in a couple of days :)
I've created an ohloh account, now I have to figure out how to claim those commits ;)
Comment #9
rszrama commentedIf you haven't already found it, you should be able to just click the "I am this person" button at your contributor page:
https://www.ohloh.net/p/drupalcommerce/contributors/1684200558214278
Comment #10
pcambraThanks rszrama, I've just claimed my ohloh profile :)
I have changed all handlers in my local copy after pulling from your repos and when I've properly retested them, I will request another git push.
(note to myself in the future: git pull git://github.com/rszrama/drupalcommerce.git master)
The field in the commerce_order table is "status" so I've changed this handler's name
commerce_order_handler_field_order_order_status.inc
for
commerce_order_handler_field_order_status.inc
to have all named the same way.
Comment #11
rszrama commentedAhh, good catch.
Comment #12
pcambraPull requested on github
Comment #13
rszrama commentedCommitted! I made one final tweak and that was to the line item / product type handlers. The field in the DB is simply called "type" for both of those, so I removed the extra line_item_ and product_ prefixes. Thanks, Pedro! : )