3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ --------------------------------------------------------------------------
Line block_token.module
------ --------------------------------------------------------------------------
57 Call to deprecated method entityManager() of class Drupal:
in Drupal 8.0.0 and will be removed before Drupal 9.0.0.
Use \Drupal::entityTypeManager() instead in most cases. If the needed
method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the
deprecated \Drupal\Core\Entity\EntityManager to find the
correct interface or service.
60 Call to deprecated function drupal_render():
as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the
82 Call to deprecated function db_like():
as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
a database connection injected into your service from the container and
call escapeLike() on it. For example,
------ --------------------------------------------------------------------------

[ERROR] Found 3 errors

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joy29 created an issue. See original summary.

rudranil29’s picture

StatusFileSize
new1.03 KB

deprecated method remove

rudranil29’s picture

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

Status: Needs review » Needs work

CONTRIBUTED PROJECTS
--------------------------------------------------------------------------------
Block Token 8.x-1.0-alpha1+1-dev
Scanned on Sat, 06/20/2020 - 11:43.

1 error found. 1 warnings found.

C:\xampp\htdocs\d\drupal9\app\modules\contrib\block_token\src\BlockToke
nPermissions.php:
┌─────────┬──────┬─────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├─────────┼──────┼─────────────────────────────────────────────────────────────┤
│ Fix now │ 28 │ Parameter $entity_manager of method │
│ │ │ Drupal\block_token\BlockTokenPermissions::__construct() has │
│ │ │ typehint with deprecated interface │
│ │ │ Drupal\Core\Entity\EntityManagerInterface. Deprecated in │
│ │ │ drupal:8.0.0 and is removed from drupal:9.0.0. │
│ │ │ │
└─────────┴──────┴─────────────────────────────────────────────────────────────┘

modules/contrib/block_token/block_token.info.yml:
┌──────────┬──────┬────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼────────────────────────────────────────────────────────────┤
│ Check │ 0 │ Add core_version_requirement: ^8 || ^9 to │
│ manually │ │ modules/contrib/block_token/block_token.info.yml to │
│ │ │ designate that the module is compatible with Drupal 9. See │
│ │ │ https://drupal.org/node/3070687. │
│ │ │ │

Ravi_3596’s picture

Status: Needs work » Needs review
StatusFileSize
new2.59 KB
new1.57 KB

Updated patch. Please review !!

smrutha’s picture

Status: Needs review » Reviewed & tested by the community

Patch #5 looks good.

benjamindamron’s picture

Any chance we can get this committed? Or does anyone know a way around composer not wanting to pull this down?

ntaylor1994’s picture

I also need this committed so I can go to D9.

Thanks

astringer’s picture

Ditto to #8. Can we get this committed?

bestller made their first commit to this issue’s fork.

mighty_webber’s picture

@bestller, Using this branch, I'm getting an error regarding the lack of composer.json file. Can I be given write access to this repo/branch or have you add a composer.json to that merge request please?

mighty_webber’s picture

Disregard, I gained access and pushed the changes to your existing fork.

chiril.ungureanu made their first commit to this issue’s fork.

mighty_webber’s picture

Priority: Normal » Major

Additional changes were required to make this module work properly. New Merge Request created and pushing this up to "Major" priority.

i-trokhanenko’s picture

+1 RTBC

mlncn’s picture

Wanted to echo that this is RTBC!

For any who want to start using it, you can bring it in by adding the following to your composer.json file:

{
    "repositories": {
        "block_token": {
            "type": "git",
            "url": "git@git.drupal.org:issue/block_token-3089830.git"
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": ["drupal/block_token"]
        },
    },
    "require": {
        "drupal/block_token": "dev-3089830-drupal-9-deprecated@dev",
        "drupal/core-recommended": "^9"
    }
}

One bit of warning that can be an issue to work on once this patch/merge request is accepted, if you use a token for a block that is not placed anywhere, or that you had placed but then removed, it causes a fatal error:

TypeError: Argument 1 passed to Drupal\block\BlockViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/web/modules/contrib/block_token/block_token.module on line 60 in /var/www/html/web/core/modules/block/src/BlockViewBuilder.php on line 31
/var/www/html/web/modules/contrib/block_token/block_token.module(147): block_token_block_render('socialsimpleblo...')

Disabling the block is fine but this is something to watch out for if someone might come along and clean up "unused" blocks.

i-trokhanenko’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.