- 🇨🇭Switzerland berdir Switzerland
I think the only bit here that's not addressed yet is search, which is in \Drupal\node\Entity\Node::postSave() now, there are also node_comment hooks that update the search index.
- 🇨🇦Canada danrod Ottawa
I attached a patch that checks for
isDefaultRevision()
being set to TRUE before runningnode_reindex_node_search
and same situation forcommentInsert
orcommentUpdate
and orcommentDelete
at/core/modules/node/src/Hook/NodeHooks1.php
I'm starting to do some Core contribution so bear with me when reviewing.
- 🇨🇭Switzerland berdir Switzerland
All contributions must be merge requests.
- First commit to issue fork.
- Merge request !11353Check node default revision before reindex. → (Open) created by Sivaji_Ganesh_Jojodae
- 🇮🇳India Sivaji_Ganesh_Jojodae Chennai
Created MR to reflect the above comments.
- 🇨🇦Canada danrod Ottawa
Thanks @berdir , good to know, I'll do that next time.
- 🇺🇸United States smustgrave
Have not reviewed but issue summary appears incomplete
- 🇨🇦Canada danrod Ottawa
I improved the issue summary, hope it makes more sense.
- 🇨🇦Canada danrod Ottawa
I documented the
$comment
parameter, added some more information and created a simple$this->assertTrue()
in thetestDeterminingChanges()
test method (filecore/modules/node/tests/src/Functional/NodeSaveTest.php
) to test if the node that was updated is the default revision, and prints an informative message.It seems like a pretty obvious validation but in the real scenario that is what is being check at
./src/Entity/Node::postSave()
before updating the node access table and reindex the search table.I'm open to any suggestions on this.
- 🇺🇸United States smustgrave
Leaving tests tag as the test-only pipeline is passing when I'd expect it to fail.
- 🇨🇦Canada danrod Ottawa
I refactored the test in a new function,
testNodeDefaultRevision()
, which checks that previous revisions of the node are not reindexed by looking at the index tables.https://git.drupalcode.org/project/drupal/-/merge_requests/11353
The test-only pipeline is not passing this time
https://git.drupalcode.org/issue/drupal-1522154/-/jobs/4911642