- Issue created by @2dareis2do
- First commit to issue fork.
- Status changed to Needs review
12 months ago 11:20am 28 February 2024 - πΊπ¦Ukraine AstonVictor
Prepared a new MR that forces enable the setting.
It also contains an install hook to enable the setting for all node types on installing the module.Let me know if we should add an update hook as well.
thanks
- π¬π§United Kingdom 2dareis2do
Thanks for looking into this.
Looking at your change it looks like you are
1. using hook_ENTITY_TYPE_presave to make sure nodes saved have setDisplaySubmitted if this module is enabled
My concern here would be this is not very opaque what is going on here. Also it is changing the default drupal behaviour.
2. provides a hook_install to make sure that all nodes have setDisplaySubmitted set to true.
If I understand this correctly, this is quite a heavy operation, depending on the size of your site. Interesting, but perhaps this is beyond the scope of this change?
I also notice you are hiding the existing setting with this module. Not sure why that is being done?
e.g.
/** * Implements hook_form_FORM_ID_alter(). */ function manage_display_form_node_type_form_alter(&$form, FormStateInterface $form_state, $form_id) { // Hide display_submitted in GUI. $form['display']['#access'] = FALSE; }
My point is that it might be easier and simply not hide this feature?
One consequence of hiding this means I have to disable this module to make that change which is already in core.
Can we not provide some info on install to explain this needs to be enabled for this module to work and/or simply make sure that it is enabled on install.
- Status changed to Postponed: needs info
11 months ago 4:24pm 13 April 2024 - π¬π§United Kingdom adamps
With this module, "Display author and date information" should not be needed and it should have no effect whatever the setting. For this reason we hide the setting to avoid confusion. So I would say this issue is "works as designed".
When enabling this module, I believe this works differently if you have already selected to hide the "Display author and date information".
Please can you explain. In what way does it work differently?
- π¬π§United Kingdom 2dareis2do
iirc without this being enabled there is no date and author info
if it is enabled it behaves differently.
fyi I am using DS now as that seems to have functionality that should probably be in core. i.e. control of label names and also control over author date updated date and lots more.
- π¬π§United Kingdom adamps
With this module it works differently - you just add the date/author fields using "Manage Display" settings.
- π¬π§United Kingdom 2dareis2do
I think DS works with all base fields, including date and author
- π¬π§United Kingdom adamps
Sure, however I was comparing this module to Core.
In Core it depends on "Display author and date information".
With this module, you add the date/author fields using "Manage Display" settings. The setting "Display author and date information" is hidden and has no effect.
At least that's how it works for me, and how it's supposed to work.
- πΊπ¦Ukraine AstonVictor
Hi there,
I tested the setting with different modules (layout builder, display suit, etc) and it has no effect because we add author information in the alter hook -
manage_display_entity_base_field_info_alter()
p.s. you can use the MR as the patch to force enable the setting for all your node types.
thanks