| 00:00 | * | cosine has quit (*.net *.split) |
| 00:02 | * | cosine has joined |
| 14:44 | mstenta[m] | What do y'all think about this as a simple first step before 2.0.0? github.com/farmOS/farmOS/pull/619 |
| 16:39 | mstenta[m] | Also for review: www.drupal.org/project/farm/issues/32447 |
| 16:40 | mstenta[m] | Note: I just whipped that one up as a quick proof of concept to keep the conversation going - if others don't think it's the right approach we can discuss - just eager to close stuff :-) |
| 17:20 | symbioquine[m] | <mstenta[m]> "Also for review: www...." <- Looks reasonable to me - though I don't know much more about it than what we talked about on that call... |
| 17:20 | symbioquine[m] | Will use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; work without layout_builder installed? |
| 17:20 | mstenta[m] | oh i think so? |
| 17:20 | mstenta[m] | it's a good question |
| 17:21 | mstenta[m] | i'll see right now... i'll just uninstall layout_builder and make sure everything still works :-) |
| 17:21 | symbioquine[m] | Cool |
| 17:33 | mstenta[m] | > Will `use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;` work without layout_builder installed? |
| 17:33 | mstenta[m] | works fine! |
| 17:33 | mstenta[m] | i think that makes sense actually... PHP has no concept of "modules installed" |
| 17:33 | mstenta[m] | that code exists, so it's happy |
| 17:33 | mstenta[m] | it's just not going to be used |
| 17:34 | paul121[m] | <mstenta[m]> "Also for review: www...." <- how does this work with multiple view modes? I think it only alters the `default` right now, which is good. But it seems that these `asset_preprocess__full` hooks would be run for all view modes? |
| 17:35 | symbioquine[m] | mstenta[m]: And it's part of core right so it's always present? |
| 17:35 | mstenta[m] | paul121: oh hmm, maybe my assumptions were wrong - i thought `full` WAS the view mode (but you're right it's technically called `default`) |
| 17:35 | mstenta[m] | symbioquine: correct |
| 17:36 | mstenta[m] | paul121: the map_popup view mode is also enabled |
| 17:36 | mstenta[m] | always has been - and that doesn't get affected by the layout logic |
| 17:36 | paul121[m] | yeah, maybe there is something weird where full == default ? |
| 17:36 | mstenta[m] | yeaa... maybe? |
| 17:36 | mstenta[m] | it's a good question |
| 17:38 | mstenta[m] | drupal.stackexchange.com/questions/16611 |
| 17:39 | mstenta[m] | > So, when you are going to node/1, there is by default no display for `full`, so it falls back to default. Whereas `teaser` does have one, so it uses different things. However, you can also enable a form display for `full` and then it will no longer use `default`. |
| 17:39 | mstenta[m] | 🤔 |
| 17:41 | mstenta[m] | i don't see where you can "enable a form display for `full`" anywhere in the UI |
| 17:42 | mstenta[m] | second answer says: |
| 17:42 | mstenta[m] | > |
| 17:42 | mstenta[m] | There is no difference between default and full, they are essentially the same thing. "Full" is just a view mode and for some entities that is the "Default" view mode (not all though). |
| 17:42 | paul121[m] | > view_mode can basically be anything you want, you can even make up them on the fly. |
| 17:42 | mstenta[m] | s/// |
| 17:42 | paul121[m] | ?? |
| 17:43 | paul121[m] | Well, I think what you could do is create a new full view/form display |
| 17:43 | paul121[m] | just like we made the map_popup |
| 17:43 | paul121[m] | Drupal core must provide a standard teaser view display for nodes |
| 17:44 | mstenta[m] | ah ok |
| 17:44 | mstenta[m] | yea that sounds right |
| 17:45 | mstenta[m] | ah hmm... there is a difference between "view mode" and "view display" |
| 17:46 | mstenta[m] | default is the display |
| 17:46 | mstenta[m] | full is the view mode |
| 17:46 | paul121[m] | so right now we're technically altering the default and full view displays, if someone happened to make a full then it would be changed |
| 17:47 | mstenta[m] | (see comments on the first answer) |
| 17:47 | paul121[m] | yea, grokking that too.... I think "view mode" is just the name for the parameter passed to EntityViewBuilderInterface, nothing more |
| 17:48 | paul121[m] | www.drupal.org/docs/drupal-apis/entity-a |
| 17:48 | mstenta[m] | so do you see any issue with this logic? |
| 17:49 | paul121[m] | paul121[m]: wrong! view mode is the config entity too: `core.entity_view_mode.node.full.yml` |
| 17:50 | mstenta[m] | ah |
| 17:50 | paul121[m] | but also the parameter passed to that method. which, a view_mode config doesn't exists, it uses default :-) |
| 17:53 | mstenta[m] | so just to recap: |
| 17:53 | mstenta[m] | 1. if you go to "Manage display" for an asset type, and you enable "Use layout builder", it creates a `core.entity_view_display.asset.BUNDLE.default` config |
| 17:53 | mstenta[m] | 2. we are implementing `hook_preprocess_HOOK()` to alter the theming of `asset__full`, `log__full`, and `plan__full` |
| 17:53 | paul121[m] | mstenta[m]: I don't think the `default` view mode should be hard-coded here: git.drupalcode.org/project/farm/-/merge_ |
| 17:53 | paul121[m] | only because this *could be* the `full` view mode too. kinda an edge case |
| 17:53 | mstenta[m] | so, we are specifically altering the full view mode... which is using the default display |
| 17:54 | mstenta[m] | what should be there then? full? I'm not sure that would work |
| 17:55 | mstenta[m] | default is the config that gets written to when you enable layout builder |
| 17:55 | paul121[m] | yeah me neither. I wonder if we should use a different preprocess hook somehow |
| 17:55 | * | spitz234[m] has quit (Ping timeout: 252 seconds) |
| 17:56 | paul121[m] | well you could write config to the full display as well (if you created that view mode) |
| 17:56 | * | spitz234[m] has joined |
| 17:56 | paul121[m] | but that is an existing issue, not new. this change just revealed it to me :-) |
| 17:57 | mstenta[m] | yea that makes sense |
| 17:57 | mstenta[m] | well i don't want to open up a too much of a can of worms |
| 17:58 | mstenta[m] | still trying to understand the potential issue... |
| 17:58 | mstenta[m] | right now, someone will most likely enable layout builder on the default display |
| 17:59 | mstenta[m] | but you're saying that IF they created a full view mode, and then enabled it on that, then this would break... ? |
| 17:59 | mstenta[m] | i think i see what you mean - does seem very edgy |
| 17:59 | mstenta[m] | hmm |
| 18:00 | paul121[m] | yes. but full display mode is a common convention for drupal nodes it seems, so not too far out |
| 18:01 | paul121[m] | common convention... it's like baked into the core code as the default view mode haha :P |
| 18:01 | mstenta[m] | yea |
| 18:07 | paul121[m] | maybe hook_entity_display_build_alter: api.drupal.org/api/drupal/core!lib!Drupa |
| 18:07 | paul121[m] | but we prob don't need to fix this right away |
| 18:14 | paul121[m] | an alternate approach... we could depend on layout builder and dynamically build/override the default view display to use the two column layout as needed? its a bit more complicated so I understand why we didn't do that in the beginning. but if might solve all the problems now? |
| 18:58 | mstenta[m] | yep! |
| 18:58 | mstenta[m] | we could consider that! |
| 18:58 | mstenta[m] | in which case i would say let's punt until after 2.0.0 |
| 18:59 | mstenta[m] | so: should we postpone this issue? |
| 18:59 | paul121[m] | yea, that sounds good |
| 19:00 | mstenta[m] | alrighty! |
| 19:02 | mstenta[m] | this one good to merge? github.com/farmOS/farmOS/pull/619 |
| 19:03 | mstenta[m] | (seems like you suggested as much paul121 - just wanted to be sure before i pull the trigger) |
| 19:03 | paul121[m] | yep! |
| 19:03 | paul121[m] | LGTM |
| 19:03 | mstenta[m] | cool! |
| 19:03 | mstenta[m] | i will focus on the timestamp thing now |
| 19:03 | mstenta[m] | just needs tests |