- Issue created by @luke.stewart
Update code comments to reflect reality.
Currently in core/modules/views/src/ViewExecutable.php _initHandler has a comment suggesting that expected values for the 'key' should be a string that is in the set ('argument', 'field', 'sort', 'filter', 'relationship')
While trying to debug a views handler issue I noticed that even on a clean install if viewing Watchdog various other values show up here:
namely 'empty', 'footer', and 'header'.
On a clean install of drupal either:
A) set a conditional breakpoint in web/core/modules/views/src/ViewExecutable.php _initHandler on $key being not one of the above mentioned values or
B) edit web/core/modules/views/src/ViewExecutable.php and use some php to do the same at the start of the function i.e.
if (!in_array($key, ['argument', 'field', 'sort', 'filter', 'relationship'])){
\Drupal::logger('viewdebug')->error('@key - key not on the list.', ['@key'=> $key]);
}
Head to admin/reports/dblog refresh the page and watch the entries show up.
I'm unclear if this is a case of
A) code documentation not keeping up with reality; or
B) or there being actual problems here.
I'm inclined to A)
Assuming A above update drupal core comments.
None
None
None
None
Active
11.0 🔥