- last update
over 1 year ago 2,145 pass - last update
over 1 year ago 2,149 pass - πΈπ°Slovakia poker10
There are 8 usages of the
_text_sanitize()
function in D7 core (plus some usages in tests): https://api.drupal.org/api/drupal/modules%21field%21modules%21text%21text.module/function/calls/_text_sanitize/7.xWouldn't it be better to apply the non-empty check directy into the
_text_sanitize()
function, which would cover all other usages? Otherwise this patch is optimizing only the_text_sanitize()
call in thetext_field_load()
function (not sure if this partial effort is worth the effort). But please correct me if I am wrong or if I missed something.Attaching a simple patch what I had in mind.
- last update
over 1 year ago 2,145 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,110 pass - last update
over 1 year ago 2,110 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,149 pass - πΈπ°Slovakia poker10
There are two points to consider:
1. The last patch will not catch
NULL
values (which can happen on PHP 8+). These NULLs are handled by string conversion incheck_markup
, see:$text = (string) $text;
This is not optimal, but changing to patch to catch all possible empty input values will be a bigger change. I think the current change is a safer approach.
2. We can consider moving the empty check even deeper - to the
check_markup
.Adding a tag so that another D7 maintainer can have a look.
-
mcdruid β
committed d8dd20c9 on 7.x
Issue #1821178 by heddn, poker10: Performance tune text_field_load()
-
mcdruid β
committed d8dd20c9 on 7.x
- Status changed to Fixed
over 1 year ago 5:56pm 23 May 2023 - π¬π§United Kingdom mcdruid π¬π§πͺπΊ
Yeah it's tempting to just check for an
empty()
value in the column but as you say probably safer to keep to this very straightforward change especially as we're not adding any tests here.Thanks everyone!
Automatically closed - issue fixed for 2 weeks with no activity.