Closed (fixed)
Project:
helpfulness
Version:
2.0.0
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2020 at 23:17 UTC
Updated:
31 Aug 2020 at 21:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
developerweeks commentedComment #3
developerweeks commentedNow with Report pages patched too.
drupal_get_user_timezone() is deprecated, replaced with date_default_timezone_get(); but it makes no sense to call _get_ just to immediately _set_
Replace `format_date` with `$date_formatter->format` and a service definition above it.
Unclear why, but the 'value' index was deemed illegal on the D9 instance, so removed it from the line
->set('helpfulness_comment_required', $form_state->getValue('helpfulness_comment_required')['value'])
Comment #4
gueguerreiroThank you for providing an initial patch that allows users to install this module on D9 :)
However, I think it still needs small changes before it can be accepted into the module's codebase:
On HelpfulnessBlockForm:
In this case, the
\Drupal::messengercall is not necessary, since we are already extendingFormBase, which usesMessengerTrait. You should just be able to do$this->messenger()and get the same result.This also applies to HelpfulnessConfirmDeleteFeedbackForm, HelpfulnessReportForm and HelpfulnessReportOptionsForm.
On HelpfulnessReportForm:
Agree that that code is no longer necessary since https://www.drupal.org/node/3009387. We can remove the comments too, however.
Also related, this particular change means that there would have to be a different module release for 8.8+|9 versions of Drupal and the rest, as this seems to be a breaking change (Meaning, for inferior versions, that previous code was correct and in fact necessary).
Which would also mean that a more correct value for helpfulness.info.yml would be:
Also on this file:
This service should be injected. We should avoid
\Drupal::calls in classes. The same applies for HelpfulnessReportDownloadForm.Your last point:
Is actually a bug that has been discussed here (And is also affecting D8): https://www.drupal.org/project/helpfulness/issues/3163343. A patch was also provided there. So yours is out of scope and should be removed from the patch you provided.
Comment #5
gueguerreiroRunning drupal-check on the module, I found a couple more (Truncated the output to show only the relevant deprecations that haven't been addressed yet):
Comment #6
gueguerreiroComment #7
gueguerreiroNot sure why the commit didn't pop up on the issue, but regardless.
Committed 322e78d and pushed to 2.x. Thanks!
Every website running on Drupal 8.8 or higher should update to the new 2.0.0 release.