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.

CommentFileSizeAuthor
views_FieldList_php5_fatal.patch786 bytesneclimdul
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul’s picture

Title: Fatal error in FieldList » Fatal error in Drupal\views\Plugin\views\argument\FieldList
Issue summary: View changes
neclimdul’s picture

Issue summary: View changes

Forgot to document what the actual problem is with the code.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

After #2012130: Regression: Views integration for "list" field types is broken we have proper test coverage for it.

This fix for itself is fine.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Okay - 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!

  • alexpott committed daa2c02 on 8.0.x
    Issue #2407975 by neclimdul: Fatal error in Drupal\views\Plugin\views\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.