Here is the web/core/modules/views/src/Plugin/views/PluginBase.php::viewsTokenReplace() function:
protected function viewsTokenReplace($text, $tokens) {
if (!strlen($text)) {
// No need to run filterAdmin on an empty string.
return '';
}
....
The !strlen($text) check is made to check if $text is empty or null
This is deprecated in php 8.1
maybe we can replace by:
protected function viewsTokenReplace($text, $tokens) {
if (!$text) {
// No need to run filterAdmin on an empty string.
return '';
}
....
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3344026-9.patch | 579 bytes | odai jbr |
Issue fork drupal-3344026
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 #2
cilefen commentedThere must be missing automated test coverage. How do you reproduce the bug?
Comment #3
duneblThe bug can be reproduced by embedding a view in a preprocess function like the following:
ok, when looking at this old code, I know that I could use
views_embed_view('all_inv','e_invs_of_tsc',$company->id())Comment #4
cilefen commentedDo you have the time to contribute a failing unit test inside the views module?
Comment #5
duneblSorry I don't know how to handle a test unit... and I am overbooked at 150% until may
Comment #6
smustgrave commentedAppears there was a scenario in #3
Comment #7
davemaxg commentedI believe this also happens when a field is added to an entity after entities already exist. In this case, these fields wouldn't exist in the database and would be nulls and would trigger the same error. This is happening to me on 10.2.2
Comment #9
odai jbr commentedThis patch solves the issue for version 9.5.11
Comment #10
samitk commentedComment #12
samitk commentedComment #13
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 #14
samitk commentedComment #15
smustgrave commentedThe issue summary is incomplete.
Research needs to be done to why that’s empty. Just putting a check isn’t enough.
Comment #16
joao.ramos.costa commentedThe very same issue happened to me when language configuration override contains data that differs from the expected type.
In this case https://www.drupal.org/project/tmgmt/issues/3509121.
Can be related with this line, for instance: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/confi...
If a given config entry value isn't passed it will be set as null, despite it's base config expected value/schema ?
Cheers.