Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
drupal-check results on commit hash: d473fdbbac980b5435235f53dc2f1f5205e621af
------ ---------------------------------------------------
Line src/Form/MenuExportForm.php
------ ---------------------------------------------------
66 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ ---------------------------------------------------
Line src/Form/MenuImportForm.php
------ ---------------------------------------------------
92 Call to deprecated function drupal_set_message().
94 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ --------------------------------------------------------------------------------
Line tests/src/Functional/MenuExportConfigurationFormTest.php
------ --------------------------------------------------------------------------------
Class Drupal\Tests\menu_export\Functional\Form\MenuExportConfigurationFormTest
was not found while trying to analyse it - autoloading is probably not
configured properly.
------ --------------------------------------------------------------------------------
[ERROR] Found 4 errors
Comment | File | Size | Author |
---|---|---|---|
#7 | Drupal-9-Deprecated-Code-Report-3047752-7.patch | 1.66 KB | Akanksha92 |
#4 | Drupal-9-Deprecated-Code-Report-3047752-4.patch | 1.69 KB | yogen.prasad |
#3 | Drupal-9-Deprecated-Code-Report-3047752-3.patch | 1.25 KB | yogen.prasad |
Comments
Comment #2
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #3
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #4
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #5
jerdavisBecause these forms extend ConfigFormBase, which extends FormBase, the MessengerTrait should already be added. This means that rather than calling the service, you should be able to use the MessengerTrait and call $this->messenger()->addMessage().
Comment #6
Akanksha92 CreditAttribution: Akanksha92 commentedWorking on the suggestion.
Comment #7
Akanksha92 CreditAttribution: Akanksha92 commentedPlease review the updated patch using $this->messenger.
Comment #8
Akanksha92 CreditAttribution: Akanksha92 commentedComment #9
Musa.thomasisn't duplicate of https://www.drupal.org/project/menu_export/issues/3040659 ?