Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This issue fails for several reasons:
- Core contains bugs, not covered by tests. (Someone managed to change check_markup()'s function signature, but not all instances throughout core.)
- This test does not fit into any module's .test file, but in parallel, it fits into all related module's .test files.
- I can only select one component for this issue, while the bug, as well as the test, affects several modules.
- This is where unit tests end, and inter-dependent functionality needs to be tested. Comment relies on Node, Search relies on Comment, Comment relies on Filter module. FWIW, check_markup() is invoked wrongly, and check_markup() belongs to filter.module, which is why this issue is assigned to component 'filter.module' (well, also to have it in my watchlist).
Last, but not least, this patch should fail and return 2 errors. When that happens, I'll add the two bits that should make it pass.
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal7-sun.randomName.patch | 1.11 KB | sun |
#15 | drupal.filter-comment-search-15.patch | 7.07 KB | dmitrig01 |
#14 | drupal.filter-comment-search-14.patch | 6.19 KB | dmitrig01 |
#12 | drupal.filter-comment-search-11.patch | 6.86 KB | sun |
#11 | drupal.filter-comment-search-10.patch | 7.02 KB | sun |
Comments
Comment #1
sunuhm.
Comment #3
sunAnother FAIL:
- Someone updated hook_nodeapi() to be split into individual functions and managed to invoke module_invoke() in a completely weird way:
Comment #4
sunSeriously, I thought I would fix 1 tiny bug here... I need a break.
1)
2)
3) Someone should ensure that all instances of ex. hook_nodeapi() were correctly converted into hook_node_X(), resp. module_invoke('foo', 'node_X', ...)
Anyway. This patch is RTBC.
Comment #6
sunhuh? Passes for me. Re-test.
Comment #7
sunNow invoking cron the same way like system.test. Thanks for the pointer, chx.
Comment #8
Dave ReidYeah using url() with cron.php/update.php doesn't work since the test bot runs in a subdirectory apparently. I had the same problem with tests and drupalGet() with adding a permission to run update.php.
Comment #9
chx CreditAttribution: chx commentedWow, lots of bugfixes. And, nice ASCII art.
Comment #10
Dave ReidShould be using
DRUPAL_ANONYMOUS_RID . '[search content]' => 1
, etcSide node, I should really get back on #300993: User roles and permissions API so we don't have to use code like this in tests...
Why not use drupalCreateNode() since you're not doing anything special?
And yes, the ASCII art is funny/cool...but seriously...
Comment #11
sunOf course, the contained code to setup the check_plain() filter had a purpose. search_excerpt() strips all tags from the snippet that is displayed in the search results. If the content was formatted with the wrong text format, the HTML would be escaped.
Added this last assertion and clarified @todo 2) about the node comment link that's added to search index.
Comment #12
sunIncorporated all points from Dave Reid's review in #10.
Comment #13
webchickSince there were no steps posted to reproduce the bugs identified here (grumble, mutter), I had to reverse-engineer the test to figure it out. I came across some things when I did.
There's already enough going on in this test; let's not muddy the waters more by adding comments to Pages as well; just use article. If we don't have coverage for comments on Pages, let's put it in comment.test in a separate issue, since it seems unrelated to these bugs here.
Speaking of test locations, I realize that the bugs ultimately lie in the filter system, but the test is clearly an integration test of the search functionality, and should be relocated to search.test IMO. I can't forsee anyone ever finding this test in filter.test once all of the underlying bugs are fixed.
Why do we need to specify 1 for each of them, if we're only interested in "Escape all HTML"? Again, let's please keep the test focused only to what it needs to do to exhibit the buggy behaviour. Unless this is required, in which case, please clarify in the comment. Also, please add the "Escape all HTML" keywords to the comment as well.
:P
Forgive my ignorance, but how does this prove anything? Unless I'm really tired, you're using the same text for both the title of the node and the body of the comment, so this test will pass even without this patch.
Comment #14
dmitrig01 CreditAttribution: dmitrig01 commentedFixed on all counts
Comment #15
dmitrig01 CreditAttribution: dmitrig01 commentedthis time for real
Comment #16
Dries CreditAttribution: Dries commentedLooks good. Committed to CVS. Thanks for the patch, and the reviews.
Comment #17
sunHrm. Bugs, bugs, bugs.
#295864: SimpleTest: Change randomName() method to randomString() changed the function signature of $this->randomName().
Comment #18
sunComment #19
webchickCommitted. Thanks!