A typical contribution path in Drupal
mradcliffe @mradcliffe@nokoto.org
You know how it goes... You go to configure your Media type view display to make use of a new feature and your site WSODs. This happened on... A local instance of this site.
And then you spend the next couple of hours hunting down the root cause analysis, creating a bug report, creating a test for a merge request. This is not any different from a proprietary/internal work flow except for going through the contribution process. If you find this and you’re working for a client or other site you manage, you still need to do root cause analysis (set a breakpoint), find any relevant issues, and create a test for it. And if you’re going to workaround it anyway, you should go ahead and create the bug report as a good Open Source citizen.
Anyway if anyone is looking for a nice Major bug request that might have some Novice tasks associated with it, File video formatter summary can pass NULL placeholder values to StringTranslation. I think coming up with a community consensus on whether to have either Size or Width/Height in the summary, whether "auto" is okay to use as a placeholder value since it won’t be translated, and fixing the issue based on that consensus could be Novice tasks. Probably not a good-first-issue, but definitely a good-next-issue.
This all stems from a recent change in not accepting NULL values in Drupal\Component\Utility\Html::escape due to argument typing. Oh, hey, there’s an issue about that also ;-). I find this happens most-often in \Drupal\Component\Render\FormattableMarkup::placeholderFormat. A quick hack to workaround that, which I do not recommend because it would add technical debt to your Drupal installations would be to do the following:
case '@':$args[$key] = static::placeholderEscape($value ?? '');break;case ':':$args[$key] = Html::escape($value ?? '');break;case '%':$args[$key] = '<em class="placeholder">' . static::placeholderEscape($value ?? '') . '</em>';break;But if you’re trying to just configure your site, that’ll help.