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.
We discussed earlier that it would be really nice if the formatters worked with other reference fields as well.
So the "Rendered entity" formatter could be used to render a taxonomy term, a product, or whatever.
Comment | File | Size | Author |
---|---|---|---|
#29 | entityreference-universal-formatters-1580348-29.patch | 8.6 KB | hswong3i |
| |||
#11 | 1580348-universal-formatters-11.patch | 8.39 KB | vasike |
#8 | 1580348-universal-formatters-8.patch | 8.27 KB | bojanz |
#5 | 1580348-universal_formatters-5.patch | 8.8 KB | itamar |
#1 | 1580348-universal-formatters.patch | 7.9 KB | bojanz |
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedLet's get the discussion started.
This patch works for me.
Comment #2
amitaibuI'll go over it, first thing that "jumped" out was commerce-product related stuff -- I don't think ER should deal, it should be added by an alter hook via commerce-product.
Comment #3
amitaibuThis probably needs to trigger a hook and a drupal_alter(), instead of hardcoding the list.
We can probably get this info from entity_get_info()
I think we can get the field types from the new entityreference_field_type_settings()
Comment #4
pamreed CreditAttribution: pamreed commentedHi
Do you see this patch getting into the module? Or maybe better question is How can it work with commerce product reference fields? Thank you.
Comment #5
itamar CreditAttribution: itamar commentedRe-rolling bojan's patch according to Amitai's comments - Removing commerce related definitions from entityreference.
Comment #6
itamar CreditAttribution: itamar commentedI added the commerce-product-reference specific definitions here: http://drupal.org/node/1788880
Comment #7
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe target column is *not* a field setting for entity reference. We should not stuff it in there...
Let's find another place for it.
Comment #8
bojanz CreditAttribution: bojanz commentedI don't like where #5 went either.
Commerce now has a "rendered product" formatter, so let's just remove any mention of that field type, support only core fields (term reference, basically), and remove the need to have any additional hooks.
Comment #9
amitaibuNow that commerce doesn't need it, I think we should actually take another approach -- make taxonomy term obsolete (as we'd want to do for 8.x):
Comment #10
bojanz CreditAttribution: bojanz commentedIt's too late for me to change the taxonomy_term_reference fields in Kickstart, so I will still need a patch such as this one. I'm probably not the only one.
Comment #11
vasike#8 patch rerolled
Comment #12
nwy CreditAttribution: nwy commented#11: 1580348-universal-formatters-11.patch queued for re-testing.
Comment #13
hswong3i CreditAttribution: hswong3i commented#11 patch rerolled
Comment #14
hswong3i CreditAttribution: hswong3i commentedooo miss...
Comment #15
roborn CreditAttribution: roborn commented#14: 1580348-universal-formatters-14.patch queued for re-testing.
Comment #17
roborn CreditAttribution: roborn commented#14 doesn't apply cleanly
Comment #18
guy_schneerson CreditAttribution: guy_schneerson commentedThanks guys #14 was applied cleanly for me and works great.
Comment #19
apanag CreditAttribution: apanag commented17: 1580348-universal-formatters-17.patch queued for re-testing.
Comment #20
discipolo CreditAttribution: discipolo commentedme too
Comment #21
rmathew CreditAttribution: rmathew commented#17 applies cleanly for me, using 7.x-1.1
Comment #22
asb CreditAttribution: asb commentedComing from https://www.drupal.org/project/commerce_fancy_attributes, where I've been instructed to apply "the" patch from #1580348: Make the formatters work with other reference fields.
For me, the patch from #17 doesn't work at all:
In #10, bojanz mentioned about two years ago that he'd need this pach for Commerce Kickstart, so I don't know if something is included in Kickstart 2. However, I want this bloody "Rendered entity" formatter mentioned at https://www.drupal.org/project/commerce_fancy_attributes, and it does not exist in Kickstart 2.
I might also add that appying and reverting this patch kills my Kickstart 2 installation:
So be careful when following the instructions from https://www.drupal.org/project/commerce_fancy_attributes.
Comment #23
bojanz CreditAttribution: bojanz commentedThis patch is already included in Kickstart v2, always has been.
You applied the patch twice, hence the error you saw.
Comment #24
asb CreditAttribution: asb commentedGood to know, but I still don't see the "Rendered entity" formatter mentioned at https://www.drupal.org/project/commerce_fancy_attributes :-(
Comment #25
edysmpApplied on a commerce 2.x site with fancy attributes and the render entity formatter just works.
Comment #26
hswong3i CreditAttribution: hswong3i commentedWith latest commit this patch no longer working ;-(
Comment #27
florisg CreditAttribution: florisg as a volunteer commentedRe rolled #17 against latest git checkout of 7.x-1.x
Comment #28
hswong3i CreditAttribution: hswong3i commentedRe rolled #1580348-17: Make the formatters work with other reference fields against latest git checkout of 7.x-1.x
Comment #29
hswong3i CreditAttribution: hswong3i commentedRe rolled #1580348-28: Make the formatters work with other reference fields against latest git checkout of 7.x-1.x
Comment #31
spotzero CreditAttribution: spotzero at Coldfront Labs Inc. commentedCommitted.
Comment #33
xumepadismal CreditAttribution: xumepadismal as a volunteer commentedRe-roll in #29 breaks #1674792: Rendered entity is not language aware committed earlier.
It should be
$target_langcode
instead of$langcode
:Should we revert and commit proper re-roll or just create a separate issue?
UPD: Sorry, missed that one: #2850416: Rendered entity is not language aware (again)
Comment #34
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedResolved in the other issue.