- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Message filtered based on issue β¨ Get log values (type and level) for syslog like the input box for dblog Needs review
- Status changed to Needs review
9 months ago 1:25pm 26 February 2024 - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Added PHPUnit test coverage.
- πͺπΈSpain tunic Madrid
I've added some comments to the MR. In general, the patch looks good to me.
- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
If this issue is merged, we recommend releasing a new version. 4.x
- π¨π¦Canada harika gujjula
harika gujjula β made their first commit to this issueβs fork.
- Status changed to Needs work
8 months ago 8:21pm 8 March 2024 - π¨π¦Canada harika gujjula
@Pasqualle, @EduardoMoralesAlberti, @tunic Thank you for all your thoughts and work on Refactoring this module. The patch seems to be good as per the pointers mentioned. But, Looks like there are few issues noticed with the merge request.
- The form values does not appear to be saved for Db log Severity levels and syslog severity levels. This is because the type in Schema file is defined as boolean where it is expecting a string. Also accordingly update Schema and install files if necessary.
- Minor Warnings noticed on Trait when log values are empty.
- It would be good to include few readability changes alongside.
- Update description text for "Enter DB Log type and Severity Levels" for both DBlog and Syslog to "Enter Log type and Severity Levels" on the Form.
- Update help text for "Enter one value per line, in the format log_type|level1,level2,level3..|message to restrict the log messages stored, the message and the level are optionals." to "Enter one value per line, in the format log_type|level1,level2,level3..|message to limit the log messages stored, the message and the level are optionals."
- Status changed to Needs review
8 months ago 11:02am 11 March 2024 - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
@harika gujjula
1. The form values does not appear to be saved for Db log Severity levels and syslog severity levels. This is because the type in Schema file is defined as boolean where it is expecting a string. Also accordingly update Schema and install files if necessary.
Did you execute the module update?
There is an update for this point, it takes the actual config on string format and transform it to booleans.
If you have any problem with the update, please let me know.
https://git.drupalcode.org/project/dblog_filter/-/merge_requests/9/diffs...switch ($key) { case 'severity_levels': case 'syslog_severity_levels': $severity_levels = [ 'critical' => FALSE, 'notice' => FALSE, 'emergency' => FALSE, 'alert' => FALSE, 'error' => FALSE, 'warning' => FALSE, 'info' => FALSE, 'debug' => FALSE, ]; $levels = (isset($config_raw_data[$key]) && is_array($config_raw_data[$key])) ? $config_raw_data[$key] : []; foreach ($levels as $level => $value) { if ($value && isset($severity_levels[$level])) { $severity_levels[$level] = TRUE; } } $config->set($key, $severity_levels); break;
2. Minor Warnings noticed on Trait when log values are empty.
It is also possible that is related with the update, could you give us more information of the warnings? We could not reproduce it.
It would be good to include few readability changes alongside.
Update description text for "Enter DB Log type and Severity Levels" for both DBlog and Syslog to "Enter Log type and Severity Levels" on the Form.
Update help text for "Enter one value per line, in the format log_type|level1,level2,level3..|message to restrict the log messages stored, the message and the level are optionals." to "Enter one value per line, in the format log_type|level1,level2,level3..|message to limit the log messages stored, the message and the level are optionals."The text was updated on commit https://git.drupalcode.org/project/dblog_filter/-/merge_requests/9/diffs...
- Status changed to Needs work
8 months ago 7:53pm 12 March 2024 - π¨π¦Canada harika gujjula
@EduardoMoralesAlberti, Thanks for the work again.
Did you execute the module update? There is an update for this point, it takes the actual config on string format and transform it to booleans.
You were right. I missed to execute the update hook. Thanks. Now I see the config is saved, but the default values are not still populated on the form? And this is noticed with both dblog severity levels, syslog severity levels. Might have to just update #default_value as per the transformation from string to boolean ?
$form['dblog']['severity_levels'] = [ '#type' => 'checkboxes', '#title' => $this->t('Select Severity Levels'), '#description' => $severity_description, '#options' => $severity_levels, '#default_value' => $config->get('severity_levels') ?? [], ];
Minor Warnings noticed on Trait when log values are empty.
It is also possible that is related with the update, could you give us more information of the warnings? We could not reproduce it.You were right again. This is due to the missing update hook. So, the cause for the warning earlier was due to the log_values config was of type string and foreach in LogTrait is throwing warnings. The log values is an array now after the update. This is now good.
Thank you for the description text updates too.
- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
@harika gujjula We refactor the default value code to check the config saved, sorry we missed it, thank you.
Could you test it again and confirm?Commit https://git.drupalcode.org/project/dblog_filter/-/merge_requests/9/diffs...
- Status changed to Needs review
8 months ago 9:58am 13 March 2024 - Status changed to RTBC
8 months ago 7:28pm 20 March 2024 - π¨π¦Canada harika gujjula
Perfect! Looks good now. Thanks for all your work.
-
harika gujjula β
committed 63491433 on 8.x-3.x authored by
Eduardo Morales Alberti β
Issue #3211112 by Eduardo Morales Alberti, harika gujjula, Pasqualle,...
-
harika gujjula β
committed 63491433 on 8.x-3.x authored by
Eduardo Morales Alberti β
- π¨π¦Canada harika gujjula
Released a new version 4.0 with all the changes captured.
Also added support for Drupal 11.Thanks all for all your time.
- Status changed to Fixed
8 months ago 8:42pm 20 March 2024