Make sure Display author and date information is enabled first

Created on 21 February 2024, 4 months ago
Updated 18 April 2024, about 2 months ago

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.

πŸ› Bug report
Status

Postponed: needs info

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @2dareis2do
  • First commit to issue fork.
  • Status changed to Needs review 4 months ago
  • πŸ‡ΊπŸ‡¦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 2 months ago
  • πŸ‡¬πŸ‡§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.

Production build 0.69.0 2024