First, thanks for a great module. Not sure why this functionality is not in core?

When enabling this module, I believe this works differently if you have already selected to hide the "Display author and date information".

Once this module is enabled, the option to enable it again seems to be removed.

Can we make sure that "Display author and date information" is enabled before enabling this module, or
enable the option to enable the "Display author and date information" once this module is enabled.

Thanks.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

2dareis2do created an issue. See original summary.

AstonVictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Active » Needs review

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

2dareis2do’s picture

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.

adamps’s picture

Status: Needs review » Postponed (maintainer needs more info)

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?

2dareis2do’s picture

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.

adamps’s picture

With this module it works differently - you just add the date/author fields using "Manage Display" settings.

2dareis2do’s picture

I think DS works with all base fields, including date and author

adamps’s picture

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.

astonvictor’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

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