Unverified Commit ed5f0fba authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3088917 by quietone, gbirch, marvil07, Wim Leers: Map text_plain field...

Issue #3088917 by quietone, gbirch, marvil07, Wim Leers: Map text_plain field formatter to basic_string for long text fields

(cherry picked from commit 775223c0)
parent 63b8c894
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public function getFieldFormatterType(Row $row) {
        break;

      case 'string_long':
        $formatter_type = str_replace('text_default', 'basic_string', $formatter_type);
        $formatter_type = str_replace(['text_default', 'text_plain'], 'basic_string', $formatter_type);
        break;
    }

+3 −2
Original line number Diff line number Diff line
@@ -25,12 +25,13 @@ protected function setUp(): void {
  }

  /**
   * Data provider for getFieldFormatterType().
   * Data provider for testGetFieldFormatterType().
   */
  public function getFieldFormatterTypeProvider() {
    return [
      ['text', 'text_plain', 'string'],
      ['text_long', 'text_default', 'basic_string'],
      ['text_long', 'text_plain', 'basic_string'],
    ];
  }

@@ -39,7 +40,7 @@ public function getFieldFormatterTypeProvider() {
   * @covers ::getFieldType
   * @dataProvider getFieldFormatterTypeProvider
   */
  public function testGetFieldType($type, $formatter_type, $expected) {
  public function testGetFieldFormatterType($type, $formatter_type, $expected) {
    $row = new Row();
    $row->setSourceProperty('type', $type);
    $row->setSourceProperty('formatter/type', $formatter_type);