'http_response', 'rendered', // FinishResponseSubscriber adds this cache tag to responses that have the
// 'user.permissions' cache context for anonymous users.
'config:user.role.anonymous', ]);
// Let's update a node title on the first page and ensure that the page
// cache entry invalidates.
$node = Node::load(10); $title = $node->getTitle() . 'a'; $node->setTitle($title); $node->save();
// Node should still appear on the outline for admins.
$this->drupalGet('admin/structure/book/' . $this->book->id()); $this->assertSession()->elementsCount('xpath', '//table//ul[@class="dropbutton"]/li/a', count($nodes));
// If a title is provided, process it.
if(!empty($this->options['title'])){ $value = $this->globalTokenReplace($this->options['title']); $this->view->setTitle($this->sanitizeValue($value, 'xss_admin')); } }
/**
* {@inheritdoc}
*/ publicfunctionrender($empty = FALSE){ // Do nothing for this handler by returning an empty render array.
return[]; }
$node_fr = $node->addTranslation('fr', $node->toArray()); $node_fr->setTitle('French Published Node'); $node_fr->save(); $this->assertEquals('published', $node_fr->moderation_state->value);
// Create a pending revision of the original node.
$node->moderation_state = 'draft'; $node->setNewRevision(TRUE); $node->isDefaultRevision(FALSE); $node->save();
// For the pending english revision, there should be a violation from draft
// to archived.
// If an aggregation is to be created on a to many association that is already stored as a filter.
// The association is therefore referenced twice in the query and would have to be created as a sub-join in each case.
// But since only the filters are considered, the association is referenced only once.
// In this case we add the aggregation field as path to the criteria builder and the join group builder will consider this path for the sub-join logic
$paths = array_filter([$this->findToManyPath($aggregation, $definition)]);
// Revision 4.
// Trigger translation changes in order to show the revision.
$node = $storage->load($node->id()); $node->setTitle($this->randomString()); $node->isDefaultRevision(FALSE); $node->setNewRevision(TRUE); $node->save();