Skip to content
Snippets Groups Projects
Verified Commit 973d283b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3128190 by phthlaap, Keshav Patel, msuthars, sja112, rlmumford,...

Issue #3128190 by phthlaap, Keshav Patel, msuthars, sja112, rlmumford, Prashant.c, smustgrave, quietone: FieldItemDataDefinition::getLabel() should show the label of the field type

(cherry picked from commit 94b03bcd)
parent c57ce025
No related branches found
No related tags found
27 merge requests!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!7078Issue #3320569 by Spokje, mondrake, smustgrave, longwave, quietone, Lendude,...,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #108893 passed with warnings
Pipeline: drupal

#108910

    Pipeline: drupal

    #108906

      Pipeline: drupal

      #108901

        +1
        ...@@ -87,4 +87,19 @@ public function setFieldDefinition($field_definition) { ...@@ -87,4 +87,19 @@ public function setFieldDefinition($field_definition) {
        return $this; return $this;
        } }
        /**
        * Gets the label of the field type.
        *
        * If the label hasn't been set, then fall back to the label of the
        * typed data definition.
        *
        * @return string
        * The label of the field type.
        *
        * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
        */
        public function getLabel() {
        return parent::getLabel() ?: $this->getTypedDataManager()->getDefinition($this->getDataType())['label'];
        }
        } }
        ...@@ -99,4 +99,16 @@ protected function assertSavedFieldItemValue(EntityTest $entity, string $expecte ...@@ -99,4 +99,16 @@ protected function assertSavedFieldItemValue(EntityTest $entity, string $expecte
        $this->assertEquals($expected_value, $entity->{$this->fieldName}->value); $this->assertEquals($expected_value, $entity->{$this->fieldName}->value);
        } }
        /**
        * Tests \Drupal\Core\Field\TypedData\FieldItemDataDefinition::getLabel().
        */
        public function testGetLabel(): void {
        $data_definition = \Drupal::service('typed_data_manager')->createDataDefinition('field_item:string');
        $this->assertEquals('Text (plain)', $data_definition->getLabel());
        $label = 'Foo bar';
        $data_definition->setLabel($label);
        $this->assertEquals($label, $data_definition->getLabel());
        }
        } }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment