Hi guys,

Following up with #1319810: Improve Entity Relationships in Views, I was brought to look closer at the Product Reference and Customer modules.

Currently, both modules seem to implement hook_field_views_data in different places and I was wondering if it would be possible to make the code consistent:

 

Would there be any particular reason why hook_field_views_data would be implemented in commerce_customer.module rather than commerce_customer.views.inc?
 

This may sound pretty minor, but I think it would be a rather easy/simple change that could get modules' code aligned with the same consistency.
I would greatly appreciate to have your feedback on that and if you could let me know if I overlooked or missed anything in any of these modules' implementations or APIs.

Feel free to let me know if you would have any questions, comments or concerns on any aspects of the discussed implementations, I would be glad to explain in more details.

Thanks very much to all, in advance, for your comments, feedback, and insight.
Cheers!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DYdave’s picture

Quick follow up on this ticket.

Please find attached to this comment a patch against the 7.x-1.x version at ed9d68b in response to the suggested changes in ticket summary: commerce-move-commerce_customer_field_views_data-to-views-file-1916910-1.patch

I would guess the way it was done in Product Reference was probably the correct one, with its hook_field_views_data implementation in commerce_product_reference.views.inc, so this patch simply moves the function commerce_customer_field_views_data from commerce_customer.module, to commerce_customer.views.inc.

Patch has been tested and seems to work as expected.

Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on the patch or the request above, I would be glad to explain in more details or re-roll the patch if necessary.

I would greatly appreciate some help from module maintainers and if any of you could take a bit of time to look into the attached patch to give me your feedback/opinion on this ticket.

Any feedback, testing, changes, recommendations would be highly appreciated.
Thanks to all in advance.
Cheers!

Status: Needs review » Needs work
DYdave’s picture

Status: Needs work » Needs review

I checked, but I'm not really sure why the tests failed in #2.

Changing the status manually to needs review as an attempt to request a manual review from maintainers and other developers.
Please let me know if you are able to identify why patch from #1 would have failed, I would be glad to have it edited and re-rolled.

Thanks in advance for all your comments, feedback and testing.
Cheers!

rszrama’s picture

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

This seems like the right approach here.

joelpittet’s picture

Status: Reviewed & tested by the community » Needs work

Needs a re-roll actually.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
3.33 KB

Re-rolled.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +commerce-sprint

This is a nice clean-up. Also since I didn't change code (at least I don't think I did back in July) and I already RTBC'd it I'm just re-RTBCing this.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • rszrama committed 77b1b2f on 7.x-1.x authored by DYdave
    Issue #1916910 by joelpittet, DYdave: Move hook_field_views_data to...

Status: Fixed » Closed (fixed)

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