------ ----------------------------------------------------------------------
Line src/Controller/BlocksController.php
------ ----------------------------------------------------------------------
98 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
437 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Controller/MenuLinksController.php
------ ----------------------------------------------------------------------
85 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
463 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Controller/TaxonomiesController.php
------ ----------------------------------------------------------------------
57 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
154 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
824 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Form/TaxonomiesSyncForm.php
------ ----------------------------------------------------------------------
144 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------

Comments

joy29 created an issue. See original summary.

rudranil29’s picture

StatusFileSize
new3.83 KB

patch for drupal 9 compatibility

rudranil29’s picture

Assigned: rudranil29 » Unassigned
Status: Active » Needs review
kristen pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

meet_bhanvadia’s picture

StatusFileSize
new67.18 KB
new7.35 KB

Adding patch to remove other deprecation.

meet_bhanvadia’s picture

StatusFileSize
new8.59 KB

Please consider this patch above one was miss upload. Please review!!

smrutha’s picture

Patch #6 works good.

drupal-check -d web/modules/contrib/structure_sync
11/11 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

smrutha’s picture

Status: Needs review » Reviewed & tested by the community
ravimane23’s picture

Assigned: Unassigned » ravimane23
Status: Reviewed & tested by the community » Needs work

11/11 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ ------------------------------------------
Line src/Controller/BlocksController.php
------ ------------------------------------------
93 Call to deprecated function drush_log().
248 Call to deprecated function drush_log().
299 Call to deprecated function drush_log().
322 Call to deprecated function drush_log().
375 Call to deprecated function drush_log().
393 Call to deprecated function drush_log().
419 Call to deprecated function drush_log().
------ ------------------------------------------

------ ------------------------------------------
Line src/Controller/MenuLinksController.php
------ ------------------------------------------
78 Call to deprecated function drush_log().
235 Call to deprecated function drush_log().
344 Call to deprecated function drush_log().
400 Call to deprecated function drush_log().
418 Call to deprecated function drush_log().
445 Call to deprecated function drush_log().
------ ------------------------------------------

------ ------------------------------------------
Line src/Controller/TaxonomiesController.php
------ ------------------------------------------
147 Call to deprecated function drush_log().
314 Call to deprecated function drush_log().
468 Call to deprecated function drush_log().
497 Call to deprecated function drush_log().
618 Call to deprecated function drush_log().
678 Call to deprecated function drush_log().
785 Call to deprecated function drush_log().
------ ------------------------------------------

[ERROR] Found 20 errors

ravimane23’s picture

StatusFileSize
new17.23 KB
new9.52 KB
ravimane23’s picture

Assigned: ravimane23 » Unassigned
Status: Needs work » Needs review
smustgrave’s picture

The patch from #10 seemed to work for me on the dev version of the module. Is there anything else to worry about?

carwin’s picture

Status: Needs review » Reviewed & tested by the community
11/11 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


[OK] No errors                                                                                                         

Patch in #10 seems to resolve this. Marking RTBC.

  • joy29 authored 2e99157 on 2.x
    Issue #3074382 by meet_bhanvadia, ravimane23, joy29, smrutha, smustgrave...
colan’s picture

Version: 8.x-1.0 » 2.0.0
Status: Reviewed & tested by the community » Fixed

Thanks! See the new 2.0.0 release.

You may want to track #3141810: Automated Drupal Rector fixes for future things.

colan’s picture

Assigned: Unassigned » colan
Status: Fixed » Needs work

The following code:

  public static function taxonomiesImportFinishedCallback($success, $results, $operations) {
    StructureSyncHelper::logMessage('Successfully imported taxonomies');

    $this->messenger()->addStatus(t('Successfully imported taxonomies'));
  }

...is causing:

Error: Using $this when not in object context in Drupal\structure_sync\Controller\TaxonomiesController::taxonomiesImportFinishedCallback() (line 822 of /app/web/modules/contrib/structure_sync/src/Controller/TaxonomiesController.php) #0 /app/web/modules/contrib/structure_sync/src/Controller/TaxonomiesController.php(221): Drupal\structure_sync\Controller\TaxonomiesController::taxonomiesImportFinishedCallback(NULL, NULL, NULL)

That needs to be a global call. Working on it.

  • colan committed 2632801 on 2.x
    Issue #3074382 by colan: Access global classes when running in static...
colan’s picture

Assigned: colan » Unassigned

Fixed as per drupal_set_message() and drupal_get_messages() replaced by Messenger service.

But now I'm seeing:

Error: Class 'Drupal\structure_sync\Controller\TaxonomiesController' not found in Drupal\structure_sync\StructureSyncHelper::importTaxonomies() (line 47 of /app/web/modules/contrib/structure_sync/src/StructureSyncHelper.php)

Any ideas? Looks like it's there to me.

This is failing on:

drush --verbose import-taxonomies --choice safe

If we had tests, this would have been caught earlier. I just created #3175581: Add tests.

  • colan committed 53bbb24 on 2.x
    Revert "Issue #3074382 by meet_bhanvadia, ravimane23, joy29, smrutha,...
  • colan committed be5c98c on 2.x
    Revert "Issue #3074382 by colan: Access global classes when running in...
colan’s picture

Assigned: Unassigned » mparker17

As this turned out to be more of a mess than expected, I reverted the bad commit and cut a new release.

mparker17’s picture

Assigned: mparker17 » Unassigned
Status: Needs work » Closed (outdated)

This patch appears to conflate drush logging with Drupal logging and uses $this in static functions, etc.

Marking as a duplicate of #3141810: Automated Drupal Rector fixes