Posted by larowlan on October 15, 2012 at 4:39am
7 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | entity system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | _wdm_ |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D7 |
Issue Summary
field_test_entity_info does not set a 'label' on the Test Entity
Instead it sets a name.
This causes warnings during testing and in Drupal 7 causes test-results to be deemed as failure when running from Jenkins using drush.
Patch to follow.
Comments
#1
Patch for fix
#2
#3
seems straight forward to me.
#4
Agreed. Looks simple enough.
#5
@beejeebus would like to see a -fail patch that demonstrates the failures without this patch.
#6
New patch adds tests
#7
The last submitted patch, field_test_entity_info-1812822-6.fail_.patch, failed testing.
#8
great, this looks ready to go.
#9
+++ b/core/modules/field/tests/modules/field_test/field_test.entity.incundefined@@ -90,7 +90,7 @@ function field_test_entity_info() {
- 'name' => t('Test entity without label'),
+ 'label' => t('Test entity without label'),
Is that right? Seems to be the opposite of what is intended?
#10
Hi @webchick
I thought the same at first, but the 'without label' is for the actual entities, not the entity type.
Eg node's label is the title.
The without label refers to the 'entity keys' not having a label entry - here's the relevant bits
// @see EntityPropertiesTestCase::testEntityLabel()'test_entity_no_label' => array(
'name' => t('Test entity without label'),
'entity class' => 'Drupal\field_test\TestEntity',
'controller class' => 'Drupal\field_test\TestEntityController',
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'revision table' => 'test_entity_revision',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
'test_entity_label' => array(
'name' => t('Test entity label'),
'entity class' => 'Drupal\field_test\TestEntity',
'controller class' => 'Drupal\field_test\TestEntityController',
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'revision table' => 'test_entity_revision',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
'label' => 'ftlabel',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
Lee
#11
Ah, ok. Thanks for the explanation.
Committed and pushed to 8.x. Thanks! Moving to 7.x.
#12
#13
Straight backport
#14
Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/735adae7f3051b4e1701dd46...
However, I'm not sure what was going on with this (in the D7 patch):
++
// Test a valid entity type but an invalid bundle.
I removed the extra lines on commit.
#15
Automatically closed -- issue fixed for 2 weeks with no activity.