awarded
comment
Force data initialization on custom module installation
Thank you, very nice idea, I never met that hook before. :-) In hindsight, yes, the translation update after every installation, I could have guessed there was something like that.
revised
Force data initialization on custom module installation
added 1 character in body
Loading…
Loading…
comment
hook_entity_bundle_field_info_alter() cannot call entity_display.repository's getViewModes()
That's a pretty interesting approach, I could identify the scenarios where I need to call my separate function à la
node
style from, yes, including upon module installation. I do a few rapid tests but I feel I'll be back accepting it soon. :-)
revised
hook_entity_bundle_field_info_alter() cannot call entity_display.repository's getViewModes()
deleted 59 characters in body
Loading…
Loading…
comment
Getting existing fields in hook_entity_bundle_field_info()
Ooops, that was a stupid oversight. For some reason I assumed the alter hook will be called for each display, not just in the beginning to define. But it's
info()
, of course. It doesn't help as much as I hoped because Commerce adds these fields to the form display mode rather than the bundle itself, actually, as I found out in the meantime, but that doesn't change the general veracity of your answer. Thanks.
Loading…
Loading…
awarded
awarded
comment
Query condition with entity referenced via custom field
OK, I see. Considering that I already have live data, the simplest approach will be a
hook_query_TAG_alter()
for these cases, I can do whatever JOIN I want then. This isn't a contrib module but an internal need for a single site. I also considered replicating the funcionality of the entity reference but with everything said thrice, it wasn't that attractive a solution... Actually, all other requirements are well served with the field as is, so there's really no need to rework the whole for just this single query.
revised
Query condition with entity referenced via custom field
added 1 character in body
Loading…
comment
Query condition with entity referenced via custom field
By the way, yes, the online discussions mention just this case,
file.target_id.entity
. Mostly identical to my case, that's why I wonder why it doesn't work for me. People discuss that file.entity
should also work because target_id
is the main property but, as I mentioned in the question, I'm perfectly happy with specifying the column manually, especially as I have three, and only one could be default, anyway.
revised
Query condition with entity referenced via custom field
added 1157 characters in body
Loading…
comment
Query condition with entity referenced via custom field
An integer that serves as a foreign key. Basically the same as
target_id
there. I'll add the schema to the question.