Commit 57b145bf authored by catch's avatar catch

Issue #2855315 by amateescu, hchonov: Remove hard-coding of revision metadata...

Issue #2855315 by amateescu, hchonov: Remove hard-coding of revision metadata fields in ContentEntityBase::getFieldsToSkipFromTranslationChangesCheck()
parent 9bd08a00
......@@ -1270,20 +1270,15 @@ public static function bundleFieldDefinitions(EntityTypeInterface $entity_type,
* An array of field names.
*/
protected function getFieldsToSkipFromTranslationChangesCheck() {
/** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
$entity_type = $this->getEntityType();
// A list of known revision metadata fields which should be skipped from
// the comparision.
// @todo Replace the hard coded list of revision metadata fields with the
// solution from https://www.drupal.org/node/2615016.
$fields = [
$this->getEntityType()->getKey('revision'),
$entity_type->getKey('revision'),
'revision_translation_affected',
'revision_uid',
'revision_user',
'revision_timestamp',
'revision_created',
'revision_log',
'revision_log_message',
];
$fields = array_merge($fields, array_values($entity_type->getRevisionMetadataKeys()));
return $fields;
}
......
......@@ -26,12 +26,12 @@ public function setDatabaseDumpFiles() {
/**
* Tests that the revision metadata fields are moved correctly.
*/
public function testSystemUpdate3000() {
public function testSystemUpdate8400() {
$this->runUpdates();
foreach (['entity_test_revlog', 'entity_test_mul_revlog'] as $entity_type_id) {
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage($entity_type_id);
$storage = \Drupal::entityTypeManager()->getStorage($entity_type_id);
/** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
$entity_type = $storage->getEntityType();
$revision_metadata_field_names = $entity_type->getRevisionMetadataKeys();
......
......@@ -1834,6 +1834,10 @@ function system_update_8301() {
->save();
}
/**
* @} End of "addtogroup updates-8.3.0".
*/
/**
* @addtogroup updates-8.4.x
* @{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment