Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
3e10914b
Commit
3e10914b
authored
Mar 31, 2010
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#757484
by catch: optimize node_save().
parent
d0f81a1f
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/node/node.module
+10
-7
10 additions, 7 deletions
modules/node/node.module
modules/node/node.pages.inc
+2
-0
2 additions, 0 deletions
modules/node/node.pages.inc
with
12 additions
and
7 deletions
modules/node/node.module
+
10
−
7
View file @
3e10914b
...
...
@@ -1072,15 +1072,14 @@ function node_save($node) {
module_invoke_all
(
'node_'
.
$op
,
$node
);
entity_invoke
(
$op
,
'node'
,
$node
);
// Update the node access table for this node.
node_access_acquire_grants
(
$node
);
// Update the node access table for this node. There's no need to delete
// existing records if the node is new.
$delete
=
$op
==
'insert'
;
node_access_acquire_grants
(
$node
,
$delete
);
// Clear internal properties.
unset
(
$node
->
is_new
);
// Clear the page and block caches.
cache_clear_all
();
// Ignore slave server temporarily to give time for the
// saved node to be propagated to the slave.
db_ignore_slave
();
...
...
@@ -3062,8 +3061,12 @@ function node_query_node_access_alter(QueryAlterableInterface $query) {
*
* @param $node
* The $node to acquire grants for.
*
* @param $delete
* Whether to delete existing node access records before inserting new ones.
* Defaults to TRUE.
*/
function
node_access_acquire_grants
(
$node
)
{
function
node_access_acquire_grants
(
$node
,
$delete
=
TRUE
)
{
$grants
=
module_invoke_all
(
'node_access_records'
,
$node
);
// Let modules alter the grants.
drupal_alter
(
'node_access_records'
,
$grants
,
$node
);
...
...
@@ -3081,7 +3084,7 @@ function node_access_acquire_grants($node) {
$grants
=
array_shift
(
$grant_by_priority
);
}
node_access_write_grants
(
$node
,
$grants
);
node_access_write_grants
(
$node
,
$grants
,
NULL
,
$delete
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
modules/node/node.pages.inc
+
2
−
0
View file @
3e10914b
...
...
@@ -401,6 +401,8 @@ function node_form_submit($form, &$form_state) {
// rebuilt and node form redisplayed the same way as in preview.
drupal_set_message
(
t
(
'The post could not be saved.'
),
'error'
);
}
// Clear the page and block caches.
cache_clear_all
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment