Problem/Motivation
Running simpletest locally, Drupal\views\Tests\PluginInstanceTest fails with the following fatal error:
Fatal error: Cannot use Drupal\Component\Utility\String as String because the name is already in use in /.../core/modules/views/src/Plugin/views/argument/FieldList.php on line 10
Being as this is passing on testbot I assume this is because I'm running I'm running PHP 5.5 locally and something changed with the way use statements are resolved. The problem though is that we have a use statement for a String class but there is another String class in the argument namespace and so which class to use is unclear.
I tried to come up with steps to produce the error in the UI outside of simpletest but even with dawehner's help was having trouble triggering the plugin to show up. Possibly because of #2012130: Regression: Views integration for "list" field types is broken?
Proposed resolution
Alias String to provide forward support to newer versions of PHP.
Comment | File | Size | Author |
---|---|---|---|
views_FieldList_php5_fatal.patch | 786 bytes | neclimdul | |
Comments
Comment #1
neclimdulComment #2
neclimdulForgot to document what the actual problem is with the code.
Comment #3
dawehnerAfter #2012130: Regression: Views integration for "list" field types is broken we have proper test coverage for it.
This fix for itself is fine.
Comment #4
alexpottOkay - test coverage coming in #2012130: Regression: Views integration for "list" field types is broken.
This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed daa2c02 and pushed to 8.0.x. Thanks!