Problem/Motivation
On D11 going to /admin/structure/webform (Structure > webforms > form) I see: TypeError:
Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in core/lib/Drupal/Core/Utility/LinkGenerator.php on line 200 in Drupal\Component\Utility\Html::escape() (line 433 of core/lib/Drupal/Component/Utility/Html.php).
Steps to reproduce
Opened the above link having not checked after upgrade to D11 (actually have not had need to look for a while)
Same happens with previous release (6.3.0)
I have 2 forms and for one $variables["text"] is empty, which is the cause, but not sure what this is supposed to represent (entity label?) or how it can be edited or data regenerated.
This might be an example of data inconsistencies caused by core changes in D11 upgrade as seen in another module?
Proposed resolution
Temp fix is to check for null value in core/lib/Drupal/Core/Utility/LinkGenerator.php doGenerate() and skip if so.
The page seems fine after this and both forms can be edited via Build buttons
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork webform-3625548
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 #4
hai nguyen commentedCreated a merge request for this fix: https://git.drupalcode.org/project/webform/-/merge_requests/953
Comment #5
andres alvarez commentedComment #6
andres alvarez commentedTested MR !953 on 6.3.x with PHP 8.3 and Drupal 11.
WebformListBuilderTestpasses (4 tests). WithWebformEntityListBuilder.phpreverted to 6.3.x,testWebformWithoutTitlefails, so the test covers the bug.The change covers all three
$entity->label()call sites inbuildRow(). The phpstan and eslint jobs fail, but both are allowed to fail and report the same errors on 6.3.x. The branch is 15 commits behind 6.3.x and needs a rebase; a test merge shows no conflicts. Moving to RTBC.Comment #7
andres alvarez commented