Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/media/src/MediaSourceBase.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
299 * @return string | 299 * @return string |
300 * The source field name. If one is already stored in configuration, it is | 300 * The source field name. If one is already stored in configuration, it is |
301 * returned. Otherwise, a new, unused one is generated. | 301 * returned. Otherwise, a new, unused one is generated. |
302 */ | 302 */ |
303 protected function getSourceFieldName() { | 303 protected function getSourceFieldName() { |
304 $base_id = 'field_media_' . $this->getPluginId(); | 304 // Some media sources are using a deriver, so their plugin IDs may contain |
305 // a separator (usually ':') which is not allowed in field names. | |
306 $base_id = 'field_media_' . str_replace(static::DERIVATIVE_SEPARATOR, '_', $this->getPluginId()); | |
305 $tries = 0; | 307 $tries = 0; |
306 $storage = $this->entityTypeManager->getStorage('field_storage_config'); | 308 $storage = $this->entityTypeManager->getStorage('field_storage_config'); |
307 | 309 |
308 // Iterate at least once, until no field with the generated ID is found. | 310 // Iterate at least once, until no field with the generated ID is found. |
309 do { | 311 do { |