Node vs NodeInterface

Just curious about something. If I pass a node to a method, is it better to use Node or NodeInterface, and what is the difference between the two when using it like this? Example. 

$node = Node::load(123);
$this->doSomethingToNode($node);
public function doSomethingToNode(NodeInterface $node) {
  ...
}

How to add a token with the flag to the Message module ?

I have a site on Drupal 8 with the Message, Flag and Token modules.

I created a custom module to create a message when an entity is created on the site.

I also created a flag to mark messages as read. His machine name is mark_message

How to add a token with the flag to the Message module ?

Here is the file message_activity_stream.tokens.inc :

Errors after updating Entity API via Extend

Hello,

Previous week I updated the Entity API module from the Extend page. After doing this, I got a lot of errors.

Since then, when clearing the cache manually, I don't get the Cache cleared success message. When updating modules manually, it gets stuck on Preparing to download selected update. I've got a product importer which also get's stuck on 0%.

Unable to uninstall Content Modertation module after installed

Hi All,

I am using Drupal Version 8.3.9. Recently, I have installed content moderation module to check the flow before explaining to client. It was worked well, but when i try to edit any content type, getting error like below

    TypeError: Argument 1 passed to Drupal\content_moderation\ModerationInformation::getWorkflowForEntity() must implement interface Drupal\Core\Entity\ContentEntityInterface, instance of Drupal\node\Entity\NodeType given, called in /core/modules/content_moderation/src/Entity/Handler/NodeModerationHandler.php on line 57

Can't set value on entity form save

Hi,
In entity form (entity = message) I have buildForm function and save function.

Before to save the message I need to populate a text field.

I have already tested :

$form['sent'][0]['#value'] = "hello world"; in buildForm

in save function :

"no pending updates" after running update.php on 8.7.3

I'm missing something but not sure what.

Two days ago I installed 8.7.3, ran update.php and all was good.

Today suddenly get an email that there are updates available.

I find out that my core is 8.6.9 (I have had 8.71 and 8.7.2 and 8.7.3 installed) - how did it slide back to that by it self?

Manually upload the 8.7.3 files on my server and run update.php and get the "no pending updates".

It is for some reason "stuck on 8.6.9" and will no let me update.

I have cleared cache on both drupal as well as chrome; made no chance at all.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x