Skip to content
Snippets Groups Projects
Commit 0e9bec38 authored by catch's avatar catch
Browse files

Issue #3037202 by claudiu.cristea, vsujeetkumar, Hardik_Patel_12, longwave,...

Issue #3037202 by claudiu.cristea, vsujeetkumar, Hardik_Patel_12, longwave, Berdir, martin107: Remove drupal_static() from node_mark()
parent bb02eb5f
No related branches found
No related tags found
17 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!1101Issue #2412669 by claudiu.cristea, Julfabre, sidharrell, catch, daffie,...,!1039Issue #2556069 by claudiu.cristea, bnjmnm, lauriii, pfrenssen, Tim Bozeman,...,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!1012Issue #3226887: Hreflang on non-canonical content pages,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!594Put each entity type table into a details element on admin/config/regional/content-language,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
......@@ -630,6 +630,10 @@ function drupal_static_reset($name = NULL) {
@trigger_error("Using drupal_static_reset() with 'taxonomy_vocabulary_get_names' as parameter is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement for this usage. See https://www.drupal.org/node/3039041", E_USER_DEPRECATED);
break;
case 'node_mark':
@trigger_error("Calling drupal_static_reset() with 'node_mark' as argument is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement for this usage. See https://www.drupal.org/node/3037203", E_USER_DEPRECATED);
break;
}
drupal_static($name, NULL, TRUE);
}
......
......@@ -187,19 +187,14 @@ function node_title_list(StatementInterface $result, $title = NULL) {
* One of the MARK constants.
*/
function node_mark($nid, $timestamp) {
$cache = &drupal_static(__FUNCTION__, []);
if (\Drupal::currentUser()->isAnonymous() || !\Drupal::moduleHandler()->moduleExists('history')) {
return MARK_READ;
}
if (!isset($cache[$nid])) {
$cache[$nid] = history_read($nid);
}
if ($cache[$nid] == 0 && $timestamp > HISTORY_READ_LIMIT) {
$read_timestamp = history_read($nid);
if ($read_timestamp === 0 && $timestamp > HISTORY_READ_LIMIT) {
return MARK_NEW;
}
elseif ($timestamp > $cache[$nid] && $timestamp > HISTORY_READ_LIMIT) {
elseif ($timestamp > $read_timestamp && $timestamp > HISTORY_READ_LIMIT) {
return MARK_UPDATED;
}
return MARK_READ;
......
<?php
namespace Drupal\Tests\node\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* @group node
* @group legacy
*/
class NodeDeprecationTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['node'];
/**
* @see node_mark()
*/
public function testNodeMarkDeprecation() {
$this->expectDeprecation("Calling drupal_static_reset() with 'node_mark' as argument is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement for this usage. See https://www.drupal.org/node/3037203");
drupal_static_reset('node_mark');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment