Context:
node.module defines the constant "NODE_NEW_LIMIT" (line 45):
/**
* Nodes changed before this time are always marked as read.
*
* Nodes changed after this time may be marked new, updated, or read, depending
* on their state for the current user. Defaults to 30 days ago.
*/
define('NODE_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
(See https://api.drupal.org/api/drupal/modules!node!node.module/constant/NODE...)
Problem:
The value should not be a constant, because it may depend on the website configuration to define the given limit.
For high performance pages for example a much lower value might be the right decision.
For edge cases a much higher value might be the right decision.
There are other issues describing the problem with the hard limit:
#766670: The {history} table in Drupal doesn't scale at all
#401328: _forum_topics_unread: SQL performance problem can kill the database
Proposed solution:
Set the limit as system variable to make it changeable and exportable.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node-new-limit-2355527-2.patch | 2.13 KB | moymilo |
Comments
Comment #1
anybodyComment #2
moymilo commentedAdd node new limit setting to system_performance_settings form.
Comment #3
moymilo commentedComment #4
dcam commentedIt looks like this constant was moved into the history module for D8 and is now called HISTORY_READ_LIMIT, but the value is still the same. The change will have to be made there first.
Comment #5
yogen.prasad commentedComment #6
yogen.prasad commented@dcam , currently there is not any configuration settings form for history module,
should we need to create one?
Comment #7
moymilo commentedRework patch for the the Drupal 8.
Comment #9
moymilo commentedComment #10
moymilo commentedComment #13
anybodyComment #14
moymilo commentedPatch #2 for D7, is it fits like backport to D7?
Comment #20
vladbo commentedDuplicate of #2006632: Make HISTORY_READ_LIMIT configurable
Comment #21
anybodyThen let's use this separate issue for Drupal 7, see Patch #2.