- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
Soft-postponed on 📌 [3.x] Follow-up: Integrate multiple notification objects with AJAX Active
- 🇩🇪Germany lrwebks Porta Westfalica
I see two options here:
- We gather all different message types used in Core and list them in the description
- We use the function below from the Database Logging module which provides a neat SQL query result for us and list them as "Message Channels that have appeared so far" or something like that, in the description. (Better Option in my opinion)
function _dblog_get_message_types() { return \Drupal::database()->query('SELECT DISTINCT([type]) FROM {watchdog} ORDER BY [type]') ->fetchAllKeyed(0, 0); }
I would however refrain from using an HTML list, as there can sometimes be a lot of different channels and that would just make the Form a bit long... Maybe just a comma separated paragraph?
- 🇩🇪Germany Anybody Porta Westfalica
Yeah or a combination of both!
Important for (2): We'd then have to add this, if core's dblog module is enabled by using:
$moduleHandler = \Drupal::service('module_handler'); if ($moduleHandler->moduleExists('dblog')) { // Code Here }
Feel free to implement a clever combination of both. I think for the static textual representation it would be enough to list some typical examples:
- access denied
- content
- cron
- form
- locale
- php
- system
- user
This could then be extended dynamically by the result from the dblog query, if the module is installed.
All in all we shouldn't invest > 1H here.
Go for it @LRWebks :)
- Assigned to lrwebks
- Status changed to Needs work
9 months ago 7:12am 18 July 2024 - Status changed to Needs review
9 months ago 8:25am 18 July 2024 - 🇩🇪Germany lrwebks Porta Westfalica
I have a feeling that you might like this :)
Unfortunately, the Database Logging module does not provide this function via a service, so I wrote a helper function to get the SELECT myself (this also removes the dependency on DBLog entirely) and I also added your suggestions for the "Commonly used channels" as I think they are pretty reasonable to be listed at all times.
What do you think? - Status changed to Needs work
9 months ago 10:05am 18 July 2024 - 🇩🇪Germany Anybody Porta Westfalica
Final improvements (documentation). Then this is ready! You've tested it manually?
We don't need a test for this. - Status changed to Needs review
9 months ago 10:27am 18 July 2024 - Issue was unassigned.
- Status changed to RTBC
9 months ago 10:32am 18 July 2024 - Status changed to Fixed
9 months ago 10:37am 18 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.