https://www.drupal.org/pift-ci-job/2029406
Render callbacks must be a closure or implement TrustedCallbackInterface or RenderElementInterface.
3x: Render #lazy_builder callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\rate\RateEntityVoteWidget::buildRateVotingWidget. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725
3x in ViewsFilterTest::testFilterMin from Drupal\Tests\rate\Functional\ViewsFilterTest.php
See https://git.drupalcode.org/project/rate/-/blob/8.x-1.x/src/Plugin/views/...
public function render(ResultRow $values) {
$entity = $this->getEntity($values);
$widget = [];
if ($entity) {
$widget = [
'#lazy_builder' => ['rate.entity.vote_widget:buildRateVotingWidget',
[
$entity->id(),
$entity->getEntityType()->id(),
$entity->bundle(),
$this->options['widget_type'],
],
],
'#create_placeholder' => TRUE,
];
}
return $widget;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 3091133-21.patch | 895 bytes | kapilv |
| #18 | 3091133-16.patch | 1.04 KB | manish_tapadar |
| #15 | 3091133-15.patch | 4.61 KB | krzysztof domański |
| #10 | drupal-9-report_rate-3091133-10.patch | 3.21 KB | -enzo- |
Comments
Comment #2
tomvanetten commentedFixed drush_print by recommended output()->println()
Fixed drupal_set_message() by using \MessengerInterface::addMessage()
Fixed entity_get_display() by Drupal::service('entity_display.repository')->getViewDisplay()
added Add core_version_requirement: ^8 || ^9 to rate.info.yml
Comment #3
tomvanetten commentedComment #4
lamp5Comment #5
tomvanetten commentedComment #6
tomvanetten commentedCreate a new enitity on the new way
Comment #7
tomvanetten commentedComment #8
tomvanetten commentedComment #9
krzysztof domański@tomvanetten Thank you for a contribution on Rate.
Here are additional issues for this:
#3074633: Replace deprecated entity_get_display()
#3073450: Replace deprecated drupal_set_message() with \Drupal::messenger()
Comment #10
-enzo- commentedHi @Krzysztof Domański & @tomvanetten
I did a re-roll, because patch #6, have some issues with src/RateBotDetector.php becuase the branch 8.x-1.x already have those changes.
After more those change I ran drupal-check again and got this results.
But after downloading the Votinapi module, the errors were solved.
Please review and let me know if we are good for Drupal9
Comment #11
-enzo- commentedComment #12
krzysztof domański1. Let's add a separate problem for Drush deprecation. Also we can bump the minimum required version to 9.
https://docs.drush.org/en/latest/install/#drupal-compatibility
composer.json
2. Should be
method_existsinstead offunction_exists. Do we need a condition here when we bump the minimal version of Drush?Comment #13
krzysztof domańskiComment #14
krzysztof domańskiComment #15
krzysztof domańskiComment #16
krzysztof domańskiThis is a problem in Voiting API module on PHP 7.3. It has been fixed already but only in the dev version.
#3048085: time() is used as a callback, and I'm assuming it's php7.3 that doesn't like time having parameters.
Comment #17
krzysztof domańskiOne more deprecated code Render callbacks must be a closure or implement TrustedCallbackInterface or RenderElementInterface.
See https://git.drupalcode.org/project/rate/-/blob/8.x-1.x/src/Plugin/views/...
Comment #18
manish_tapadar commentedFor #lazy_builder callbacks must be methods of a class that implements TrustedCallbackInterface we need to upload this patch as well
Comment #19
krzysztof domańskiNeeds a re-roll.
Comment #20
kapilv commentedComment #21
krzysztof domańskiComment #22
kapilv commentedHean a re-roll patch.
Comment #23
jeroentThis module now has a Drupal 9 release, so I guess we can close this issue?
Comment #24
krzysztof domańskiThere is one more deprecated code.
Render callbacks must be a closure or implement TrustedCallbackInterface or RenderCallbackInterface
Comment #25
ivnishYes, I think this issue can be closed. Code style issues will be fixed in another issues