Closed (fixed)
Project:
Rabbit Hole
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2017 at 04:56 UTC
Updated:
2 Nov 2020 at 20:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
imyaro commentedPlease review my patch - I think that it might be helpful for many rabbit hole and commerce module users.
I don't know if we should add Commerce Orders support, because usually it not needed for orders.
Other commerce entities does not have it own page and don't think that we will need to add it.
Thanks
Comment #3
imyaro commentedUpdated patch.
Changed plugin name from hr_commerce_product to rh_commerce product.
Comment #4
0sarah0al commentedThe patch works..
Awesome..
Thanks alot
Comment #5
kala4ekWorks like a charm in production.
Comment #6
steveoriol+1, the patch works on 1.x-dev, permissions OK...
Comment #7
abrammRTBC.
I'm using this patch on production for almost a year.
Comment #8
hitchshockRTBC.
Patch works good.
Comment #9
rollins commentedGreat work zvse!
Thank you.
Comment #10
markdcThe option to override Rabbit Hole settings per product entity does not work. I see the Rabbit Hole Settings form on the commerce product form. But choosing another option has no effect on the form, nor does saving a different value.
Steps to reproduce:
Comment #11
daniel korteI cleaned up the patch in #3 so this new module matches the other sub modules in RH more closely.
Also, I can confirm the issue in #10 exists, but not sure why.
Comment #12
leendertdb commentedI tested the patch in #11 and it works perfectly for the commerce_product entity. I also took the time to debug the issue noticed in #10. I found out that one of the commerce_product form parent elements has a form API parameter
'#tree' => TRUE. This causes all child fieldsets (of which the rabbit_hole form is one) to be posted in a hierarchical format as well.However the rabbit_hole module itself expects all properties to be available in the top level $form_state values array, here an example:
I added a new patch based on #11 which adds a
'#tree' => FALSEproperty to the main rabbit_hole form element in src/FormManglerService.php. With this extra line the override per commerce_product works as expected.Updated patch and interdiff attached.
Comment #13
leendertdb commentedComment #14
leendertdb commentedRerolling patch of #12 (made a mistake while generating the diff, it did not apply). Changes are exactly the same.
Comment #15
daniel korteNice work @leendertdb! I am surprised this wasn’t caught until now. That fix does the trick. Patch looks good to me.
Comment #16
loze commentedPatch works as advertised. Thanks!
+1
Comment #17
stefdewa commented+1 for RTBC!
Comment #18
k.skarlatos commentedThis breaks multilingual sites. When i enable rabbit hole for a product type with a Page not found behavior, i get page not found for every language.
Comment #20
matroskeenI'm happy to announce that the latest patch was committed to 8.x-1.x branch and will be available in the next release.
It was proved by many people and our test coverage (#3177826: Add behavior invocation test coverage for rh_commerce module, #3177818: Add form additions test coverage for rh_commerce module).
@ k.skarlatos, if there are any issues with the multilingual setup, feel free to create a new issue (I believe it's not commerce-specific).
Thank you all for your contribution!