Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I navigate to Store > Products area (that normaly i expect to see only my products) there are a list of all my contents (including those that are not a product display).
Is that a bug or something that i am not doing right?
Also, in the same screen when i click on QuickEdit button the inline entity form that apears below, shows me lines (variations) that belong to other products. (Please let me know if i should create a new issue for that).
Comment | File | Size | Author |
---|---|---|---|
#38 | commerce_backoffice-node_product_generic_relationship_handler-1982728-38-7.patch | 19.93 KB | rossb89 |
#36 | provide_a_generic-1982728-36.patch | 19.88 KB | discipolo |
#35 | node_product_generic_relationship_handler-1982728-35.patch | 20.21 KB | leendertdb |
#8 | ClickOnQuickEdit.jpg | 66.05 KB | ath.galanis |
#8 | ProductList.jpg | 78.76 KB | ath.galanis |
Comments
Comment #1
ath.galanis CreditAttribution: ath.galanis commentedComment #2
rszrama CreditAttribution: rszrama commentedNot sure, but you're using Commerce Kickstart 2.x - moved this to the correct queue.
Comment #3
ath.galanis CreditAttribution: ath.galanis commentedThank you for your instant reply.
No, I have a fresh installation (not an Upadate) of Drupal Commerce 7.x-1.6 (including the patch from "Version Notes"), and of course all the other modules that it depents on, plus Commerce Backoffice modude. (All of them are installed on April 28, in their latest version).
Comment #4
rszrama CreditAttribution: rszrama commentedOk, then it must be Commerce Backoffice. Commerce by itself only ever lists product entities in the Store > Products View.
Comment #5
ath.galanis CreditAttribution: ath.galanis commentedComment #6
bojanz CreditAttribution: bojanz commentedCan you provide screenshots?
Comment #7
vasikeindeed, this issue exists.
I could reproduce it in a custom Drupal Commerce with a custom Product reference Field - field_xxx (where xxx != product - the default product reference Field)
So what actually happens is that the view is broken as the View Relationship it's broken - it doesn't exist.
I think we need at least some documentation about this on:
- http://drupal.org/project/commerce_backoffice
- http://www.drupalcommerce.org/commerce-kickstart-2/product-management-ov...
What about having a more generic Relationship as "Taxonomy terms on node" Relationship handler?
Comment #8
ath.galanis CreditAttribution: ath.galanis commentedHi,
I give you 2 screenshots.
1. "ProductList" screenshot, the only products in my store are the first three lines, all the others are nodes that belong to content types that are not product displays.
2. "ClickOnQuickEdit" screenshot, as you can see when I clik on any Quick edit button on any line, the view provides me lines from other nodes.
Comment #9
bojanz CreditAttribution: bojanz commentedHaving a relationship handler that can guess the field name for you would be great.
I don't know if it's possible or how much work it would be.
Changing to feature request.
Comment #10
vasikehere is patch that build such a Relationship Handler (inspired by "Taxonomy terms on node")
the patch also changes the "Commerce Backoffice: Products" View - uses the new Handler.
Comment #11
FMB CreditAttribution: FMB commentedvasike, I applied your patch, to no avail. I still cannot add the relevant relationship in the view (I reverted the view to its default state and cleared all caches). Unfortunately this means the "quick edit" functionality will not work properly at all... Is there some workaround in the meantime?
I would gladly help with the patch, if only I were knowledgeable enough about views handlers...
Comment #12
Rob C CreditAttribution: Rob C commentedThe missing relation handler also affects the commerce_backoffice_product_variations view, this is the view used to render the quick edit.
Comment #13
discipolo CreditAttribution: discipolo commentedwith the patch from #10 commerce_backoffice_products has the generic relationship. i just needed to edit the new relationship and check the checkbox for the product reference field that i used.
i still had to add the new relationship and contextual filter to the view used by quickedit commerce_backoffice_product_variations but now it seems to work as expected.
Comment #14
discipolo CreditAttribution: discipolo commentedhere are the exports of the adapted views:
Comment #15
vasikeindeed. the previous patch was far for complete. thank you all.
there is a new patch that should covers also the the quick edit View.
It seems there was also something wrong with the "All taxonomy terms" associated with a product - won't work within relationship - with this patch it should be fixed.
Comment #16
discipolo CreditAttribution: discipolo commentedi tested this new patch and still had to edit the new relationship and select the correct field in both views manually.
sadly this time, even though the correct products show up in quickedit, the status and price fields arent working.
Comment #17
discipolo CreditAttribution: discipolo commentedinterestingly the quickedit works when i use this implementation: https://github.com/rosenstrauch/commerce_backoffice_quickedit_ui that gives us all fields available there optionally.
Comment #18
vasike@discipolo : thank you Sir.
indeed there was an issue getting the product variations entities for the quick edit form Views field - the relationship wasn't used.
there is a new patch that should solve this.
Comment #19
vasikeforgot the patch.
Comment #20
mglamanI've got to mark this as needs work. I still have to enable the proper field on the relationship. We should be able to find this in code, so when the view import it dynamically chooses first (as it should be safe to assume first product reference field == proper one.)
Comment #21
mglamanHere is re-rolled patch. Key difference is that if
$this->options['product_reference']
is not set, it'll use the first key in the $options array. It also marks this field as required, since it is - otherwise you don't see products in the View.Otherwise kudos on that handler, vasike.
Comment #22
mglaman:) Forgot the patch
Comment #23
discipolo CreditAttribution: discipolo commentedexcitedly testing this
Comment #24
vasike@mglaman : thank for your help.
But i won't agree with your addition, this means back to a NOT generic relationship handler for products.
So with this option required will restrict the usage to the specific product reference fields and this relationship portability.
Without having a product reference field all the product reference fields found for the content types should be used for the relationship.
So maybe there should be somthing to be done - for multiple fields defined.
Comment #25
discipolo CreditAttribution: discipolo commentedhow about selecting any reference field by default and not marking them as required
Comment #26
mglamanBut, vasike, without selecting a product reference field no products displayed - at all. Or, maybe it was because I don't have field_product as the product reference field? See #2298111: Backoffice assumes product reference field is "field_product"
Comment #27
vasike@discipolo, @mglaman: thank you for your support.
now i know exactly what it's needed. soon i'll post a new patch that should work for any existing product reference field.
Comment #28
vasikeand there is a new patch that should solve the problems with the custom product reference fields.
So using this relationship with no product reference field selected will use all the product reference fields it finds.
Comment #29
mglamanvasike, awesome! I will test this out later today
Only thing I'd say is have lines 56/57 replaced by creating the $product_references variable via array_filter, and line 58 would be if(!product_references)
Comment #30
jimmynash CreditAttribution: jimmynash commentedApplied this patch to Commerce Backoffice 7.x-1.4 and it does the trick for me.
I had added some custom product reference fields to a product display and was not seeing those in the Backoffice Product listing view .
This patch made those missing products show up.
Comment #31
discipolo CreditAttribution: discipolo commentedthe patch from #28 doesnt add the new file for me (error: includes/views/handlers/commerce_backoffice_handler_relationship_node_product_data.inc: No such file or directory) so i recreated it.
didnt attempt the improvements from #29 yet
Comment #32
leendertdb CreditAttribution: leendertdb commentedThe project I'm working on also has a product reference field with a different name so the quick edit functionality broke. I can confirm the patch from #28 works as intended, everythink works OK now.
I have re-rolled the patch and included the proposed changes from #29.
Can we get this reviewed and committed to 7.x-1.x ASAP? I think a lot of (new) non-kickstart sites can have a lot of trouble with the product backoffice management page with this problem.
Comment #33
leendertdb CreditAttribution: leendertdb commentedWhoops, seems the re-rolled patch didn't contain everything. This one (#33) should work.
Comment #34
mglamanGoing to be *that* guy, but white spaces
Comment #35
leendertdb CreditAttribution: leendertdb commented@mglaman, seems I have (or well, Notepad++ has) done it wrong all my life. Thanks for the tip!
See attached the updated patch.
Comment #36
discipolo CreditAttribution: discipolo commentedmissing parenthesis
Comment #37
rossb89 CreditAttribution: rossb89 at ComputerMinds commentedThanks for the patch, I had some issues applying the patch with the latest dev (or 1.5).
There was just one issue with the product info file as there is now a files[] entry for a test file.
Re-rolled the patch against latest dev.
Comment #38
rossb89 CreditAttribution: rossb89 at ComputerMinds commentedOops, didn't include the actual class file, my bad!
Re-rolled with the missing file.
Comment #39
rossb89 CreditAttribution: rossb89 at ComputerMinds commented