Rename "watchdog_mailer_enable" config key to "enabled"

Created on 25 June 2024, 7 months ago
Updated 30 July 2024, 6 months ago

Problem/Motivation

Rename "watchdog_mailer_enable" config key to "enabled"

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • First commit to issue fork.
  • Assigned to supriyak
  • 🇮🇳India supriyak

    Hi @Anybody,

    "enabled" key is already present in watchdog_mailer.settings for another field. It is affecting to changing key for 'watchdog_mailer_enable'.
    Please suggest on this.

    Thanks!

  • Issue was unassigned.
  • 🇩🇪Germany Anybody Porta Westfalica

    Yes it's already used for the sublevel but should also be used for the top level. Only a complete implementation including correct update hook will be credited.

  • 🇮🇳India supriyak

    Thank you @Anybody for reply.

    Can you please check 'WatchdogMailerSettingsTest.php'? In this file there are no levels and sublevels, here they maintain sequence only.
    So it will be confusing here. Please suggest on this.

    I have done with my code just waiting for your reply on this.

    Thanks!!

  • Pipeline finished with Success
    7 months ago
    Total: 228s
    #209632
  • Status changed to Needs review 7 months ago
  • 🇮🇳India supriyak

    Hi @Anybody,

    Please review my changes and let me know your valuable feedback on this.

    MR - https://git.drupalcode.org/project/watchdog_mailer/-/merge_requests/23
    Commit - https://git.drupalcode.org/project/watchdog_mailer/-/merge_requests/23/d...

    Thank you!

  • Status changed to Needs work 7 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Just a last grammatical issue, then this LGTM. @LRwebks can you please fix that and test if it works as expected?

  • 🇩🇪Germany lrwebks Porta Westfalica

    Okay, I noticed that a few instances of watchdog_mailer_enable were still left in the project and then noticed the problem with the rename:
    As far as I can see this change might actually interfere with the enabled value from the Notification Object, e.g. ->set('enabled', $form_state->getValue('enabled')) appears twice and as such the submit would not work correctly.
    I think we have two options here now: Revert this change or rename the Notification Object key to something like notification_object_enabled.
    @Anybody, @supriyak: What do you think of this?

  • 🇩🇪Germany Anybody Porta Westfalica

    Nice! Technically, they can't interfere, but good finding, the author just missed these other locations! :)

    Please also test the update hook using cex before and after!

  • Pipeline finished with Failed
    7 months ago
    Total: 499s
    #225348
  • 🇩🇪Germany lrwebks Porta Westfalica

    Unfortunately, after a bit of testing it is clear that the keys do conflict with saving and dynamic visibility. If one enabled</code checkbox is enabled, then both will be saved as enabled. Similarly, the form is only hidden if BOTH checkboxed are turned off, if the <code>watchdog_mailer_enable is off and the Notification Object is still on, the Form is still visible...
    How do we solve this now?

  • Status changed to Needs review 7 months ago
  • 🇩🇪Germany lrwebks Porta Westfalica

    Well, now, after a lot of tweaking related to the fact that the different keys were unintentionally pulled to the same level within the form and were now conflicting - everything should be working now! Tests are green locally as well.

  • Pipeline finished with Success
    7 months ago
    Total: 184s
    #225421
  • Status changed to RTBC 7 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Great work! RTBC! :) And a further step into multiple notifications configurations direction :)

  • Pipeline finished with Skipped
    7 months ago
    #225575
  • Status changed to Fixed 7 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Merged!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024