Problem/Motivation
filter_autop() currently returns <br />, which is XHTML style self-closing tag syntax. As we are moving towards HTML5 compliance #1388926: Remove all references to "self-closing" void elements in core, it is necessary to replace the usage of <br /> with <br> as the correct void element for HTML5. This update ensures consistency across the codebase.
Steps to reproduce
1. Add a block of text with single and double line breaks.
2. Process it through filter_autop().
3. Observe that the function inserts <br /> tags for line breaks.
Proposed resolution
Modify the filter_autop() function to return <br> instead of <br />. Additionally, update the associated test cases to reflect this change by ensuring that the output contains <br> instead of the XHTML-style <br />.
Remaining tasks
N/A
User interface changes
No user interface changes.
Introduced terminology
No new terminology introduced.
API changes
No API changes.
Data model changes
No data model changes.
Release notes snippet
filter_autop() now returns <br> instead of <br /> to align with HTML5 void element standards.
| Comment | File | Size | Author |
|---|---|---|---|
| #68 | 2350049-68-mr-9221.patch | 3.69 KB | joegraduate |
Issue fork drupal-2350049
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
hanno commentedComment #2
legolasboThe filter now returns
<br>I've also updated the tests to reflect this change. however there is a test that keeps failing, but I can't figure out why.
Comment #3
hanno commentedGreat! let's ask the testbot why.
Comment #4
legolasboI guess the error is caused by something in my test environment, since it passes the testbot's test. The failing test seemed to be unrelated and i guess the testbot agrees.
Comment #5
jhedstromPatch still applies. Does this need to wait on #1388926: Remove all references to "self-closing" void elements in core or can it go in separately?
Comment #7
hanno commentedThere is no dependency. EDIT: as this will slightly change the html output, this is a change tht needs to be documented.
Comment #8
mgiffordre-uploading for the bots.
Comment #10
wim leersThis is due to #1333730: [Meta] PHP DOM (libxml2) misinterprets HTML5.
Comment #21
smustgrave commentedRerolled #8
Comment #23
smustgrave commentedComment #24
smustgrave commentedSame as #23 but with a tests-only patch
Comment #25
smustgrave commentedComment #28
catchShouldn't this test both until HtmlCorrector also puts out HTML 5 instead of changing from one to the other?
Comment #29
wim leers#28++
Comment #30
trackleft2Rerolled patch against 11.x
Looks like this should not have been closed since the change made in core/modules/filter/filter.module is still needed.
Comment #31
longwaveComment #32
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
Comment #35
trackleft2I've come across a specific issue following an upgrade from Drupal 10.1 to Drupal 10.2, which might be relevant for others. Below is a detailed step-by-step process to recreate this issue:
Initial Setup on Drupal 10.1:
<br>and<p>)"Content Creation:
Note: This includes a UTF-8 0A line break character after the
<br>tag.Update to Drupal 10.2 and Observation:
<br>tags where there should only be one.The patch attached to this issue #30 resolves the duplicate
issue for us.
Comment #36
mkindred commentedI think I'm running into this issue, but the circumstances are (confusingly) different.
I'm on 10.2.1, and I'm currently upgrading from ckeditor4 contrib to ckeditor5. I'm not using "Convert line breaks into HTML (i.e.
<br>and<p>)" before or after the upgrade, yet I'm seeing doubled linebreaks after the upgrade. If I open the offending node for editing, the linebreaks look normal (single), and saving the node fixes them.The only two filters I have enabled (before and after the upgrade) are:
- Limit allowed HTML tags and correct faulty HTML
- Correct faulty and chopped off HTML
If I apply patch #30 with the upgrade, it seems to fix the doubled linebreaks. If I'm not using the "Convert line breaks..." filter, should this patch affect me?
----
ETA: I was wrong about not having the filter enabled. See below.
Comment #37
longwaveFixing title, hiding patches. Added some questions to the MR.
@mkindred As far as I can tell this should only make any difference if you have "Convert line breaks into HTML" enabled. But if you can reproduce otherwise, steps to do so from a clean install would be super helpful!
Comment #38
wim leersComment #39
mkindred commented@longwave I tried and cannot reproduce this behavior on a clean install. My ckeditor upgrade involved ~10 commits, so I'm reviewing each one to see where the issue entered.
Comment #40
mkindred commentedWell, that's embarrassing. I did indeed have the "convert line breaks" filter enabled. I've been trying to remove old text formats for some time, and I didn't realize one of the older formats was still being used.
So to update: patch #30 does fix the issue for me while upgrading from ckeditor4 to ckeditor5 on D10.2.1 while using the "Convert line breaks into HTML" filter.
Comment #41
andypostComment #42
ammaletu commentedI can confirm that the Merge Request as it is fixes this issue in Drupal 10.2.5. We just upgraded from CKEditor 4 to 5 and had extra linebreaks whenever the source contained a linebreak right inside the paragraph (not sure how our customers managed to get the linebreaks there).
This issue turns 10 years old in just a couple of months. As far as I can see, the MR title needs to be changed and one change to the test case needs to be reverted. I tried to do that, but Gitlab wouldn't let me.
Comment #45
trackleft2I've created a new fork to change the title of the merge request.
I've updated the test to account for @longwave's suggestion.
I've merged in upstream changes from 11.x and resolved merge conflicts.
I've hidden the original merge request branch.
Comment #46
bberndt commentedComment #47
trackleft2Now I'm seeing these test failing.
Comment #48
trackleft2Turns out when I was fixing the merge conflicts I blew away the fix.
Once the fix was back in place, one of the test failures went away, however I discovered that the second test was expecting
<br>but was getting<br><br>.The original version of the test was actually expecting
<br><br>as well, so I changed it back, but changed the description.https://git.drupalcode.org/project/drupal/-/merge_requests/9221/diffs#38...
Comment #49
trackleft2Looks like now there are failed Functional Javascript tests, but I can't figure out what is going on.
See: https://git.drupalcode.org/issue/drupal-2350049/-/jobs/2455600
See: https://git.drupalcode.org/issue/drupal-2350049/-/pipelines/255199/test_...
I did notice some
<br>tags in the test file which may be related, https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/ckedi...Also noticed that those image tests have self closing image tags,
<img />.There was 1 failure:
1) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::testAlignment
Failed asserting that a NULL is not empty.
/builds/issue/drupal-2350049/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:500
/builds/issue/drupal-2350049/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:478
FAILURES!
Tests: 10, Assertions: 377, Failures: 1, Skipped: 1.
---- Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest ----
Status Group Filename Line Function
--------------------------------------------------------------------------------
Fail Other phpunit-5.xml 0 Drupal\Tests\ckeditor5\FunctionalJa
PHPUnit Test failed to complete; Error: PHPUnit 10.5.29 by Sebastian
Bergmann and contributors.
Runtime: PHP 8.3.10
Configuration: /builds/issue/drupal-2350049/core/phpunit.xml.dist
....F.... 9 / 9
(100%)
HTML output was generated.
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-1-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-2-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-3-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-4-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-5-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-6-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-7-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-8-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-9-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-10-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-11-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-12-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-13-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-14-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-15-65270370.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-16-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-17-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-18-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-19-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-20-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-21-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-22-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-23-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-24-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-25-82605180.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-26-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-27-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-28-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-29-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-30-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-31-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-32-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-33-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-34-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-35-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-36-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-37-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-38-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-39-39342599.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-40-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-41-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-42-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-43-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-44-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-45-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-46-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-47-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-48-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-49-47971540.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-50-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-51-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-52-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-53-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-54-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-55-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-56-67092286.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-57-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-58-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-59-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-60-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-61-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-62-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-63-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-64-44903977.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-65-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-66-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-67-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-68-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-69-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-70-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-71-76981562.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-72-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-73-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-74-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-75-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-76-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-77-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-78-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-79-34129822.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-80-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-81-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-82-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-83-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-84-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-85-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-86-32155407.html
http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_ckeditor5_FunctionalJavascript_ImageUrlTest-87-32155407.html
Time: 02:14.361, Memory: 10.00 MB
There was 1 failure:
1) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest::testAlignment
Failed asserting that a NULL is not empty.
/builds/issue/drupal-2350049/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:500
/builds/issue/drupal-2350049/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:478
FAILURES!
Tests: 9, Assertions: 389, Failures: 1.
---- Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLinkabilityTest ----
Comment #50
trackleft2I updated the fork to include upstream changes from 11.x without any additional changes and now all the Functional Javascript test pass.
Comment #51
smustgrave commentedIssue summary should use the standard template so tagged for such.
Comment #52
trackleft2Comment #53
trackleft2Comment #54
trackleft2Comment #55
trackleft2Comment #56
andypostComment #58
smustgrave commentedCleaning up MRs/patches
Ran test-only feature https://git.drupalcode.org/issue/drupal-2350049/-/jobs/2464098 which shows the coverage.
Not sure any BC concern, know filter module changes are difficult and take a while sometimes. But any 2 second research shows that
is correct for HTML5 so believe this change is correct.
Going to go on a limb, hope no BC concern, and mark
Comment #59
quietone commentedEverything looks in order here. The other MR, MR6262 has some questions/answers.
@trackleft2, thanks for commenting on the work you did and getting this to RTBC. I see that you create a new fork to change the title of the merge request. I appreciate that not everyone can edit all features of an MR but when a new MR is created it doesn't have the comments that are on the old one. That makes it just a bit harder for reviewers. It would help to use the existing MR and if you would like someone changed, ask in the issue or in Slack, #contribute. Thanks!
Comment #60
larowlanCan we resolve the questions on MR 6262 to confirm they're resolved in the new MR? thanks
Fine to self RTBC if they're resolved
Comment #62
smustgrave commentedBelieve the questions on MR 6262 have actually been addressed, went ahead and closed the MR too.
Comment #63
nod_The question was:
— In here (and some later regexes) do we need to look for any of
<br>, <br/>, <br />?— I don't think there should be any more
<br/> or <br />now that this #2441811: Upgrade filter system to HTML5 was merged.That's not reassuring, can we confirm that there is no way to have a
<br />in D11? what about when upgrading a CKE 4 config? does it hurt to keep the regexs for a couple of releases?Comment #64
niranjan_panem commentedRan the tests related to the line breaks, works as expected in drupal 11.
Comment #66
joegraduateUpdated !MR9221 with latest from 11.x and resolved merged conflicts.
Attaching current diff as updated static patch usable with composer for 11.3.x.
Comment #68
joegraduateUpdated !MR9221 with latest from main, resolved merged conflicts (involved moving changes from
_filter_autop()toFilterAutoP::process()), applied @longwave's suggestion.Attaching current diff as updated static patch usable with composer for 11.4.x.