Needs work
Project:
Publish Content
Version:
8.x-1.3
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 May 2021 at 11:36 UTC
Updated:
6 Jun 2024 at 16:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eugen zerrThis patch fixes it for me.
Comment #3
admin@azhark.com commented@Eugen
I tried with Drupal 9.3.x, but no error shows.
Can you explain the steps to reproduce in detail so i can replicate.
Comment #4
eugen zerrHi @adminazhar,
sorry for the late reply.
I can't remember why this issue appeared.
However, in D9 you can now get the node entity from the context. You no longer need to use the routematch to get the current node.
See code sample: https://gist.github.com/drubb/28b1cb5389fd33c3746b52ad57c0a0f6
and
https://www.drupal.org/docs/drupal-apis/plugin-api/plugin-contexts
Comment #5
bramdriesenSetting to NR as there is a patch
Comment #6
rodrigoaguileraRegarding #4
I don't know what is required to be able to get the node from the context in the class that needs to be modified.
Maybe use the trait like blockbase does.
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21...
Regarding the patch I think it might still fail as the code is initializing $node to NULL but later is used as $node->isTranslatable()
when it still might be NULL.