- Issue created by @pdureau
- π©πͺGermany Christian.wiedemann
christian.wiedemann β made their first commit to this issueβs fork.
- π©πͺGermany Christian.wiedemann
Hi, yes getVisibleChildren is wrong because it does not unset the element if it is empty. I optimzed the check and I also add a Unit tests for differnt cases. Have a look, not sure if I match all cases. I also go one level deeper for the check if the children are array as well.
- π«π·France pdureau Paris
You have a cspell issue:
Unknown word (preproces) -- plain_text' => '', '#preproces' => 'dummy'], FALSE
Instead of
isset($slot[$key]) && $slot[$key] == ''
, it may be better to doisset($slot[$key]) && is_string($slot[$key]) empty(trim($slot[$key])))
. what do you think?I also add a Unit tests for different cases. Have a look, not sure if I match all cases.
Thanks, can you also add a test with
#cache
? - π©πͺGermany Christian.wiedemann
I add more tests. Any more in mind? I removed the isset because isset is FALSE if '#markup' => NULL. I think we should not check for strings because empty works also with empty Markup objects.
foreach (['#markup', '#plain_text'] as $key) { if (array_key_exists($key, $slot) && empty($slot[$key])) { unset($slot[$key]); } }
-
pdureau β
committed 24b163c2 on 2.0.x authored by
christian.wiedemann β
Issue #3492962 by christian.wiedemann, pdureau: Empty slot values when...
-
pdureau β
committed 24b163c2 on 2.0.x authored by
christian.wiedemann β
Automatically closed - issue fixed for 2 weeks with no activity.