Skip to content
Snippets Groups Projects

Issue #3130107: Extend unit test coverage for LanguageNegotiationContentEntity

Open Stefanos Petrakis requested to merge issue/drupal-3130107:3130107-add-unit-test into 10.1.x
2 files
+ 19
0
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 8fe95cdf
    Issue #2925297 by Spokje, mpp, paulvandenburg, anmolgoyal74, gobinathm, catch,... · 8fe95cdf
    catch authored
    Issue #2925297 by Spokje, mpp, paulvandenburg, anmolgoyal74, gobinathm, catch, mmrares, shubhangi1995, Martijn de Wit: Fatal error on config form with translation enabled when config is missing
@@ -2,6 +2,7 @@
namespace Drupal\Core\Config;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Config\Schema\ConfigSchemaAlterException;
@@ -75,6 +76,13 @@ protected function getDiscovery() {
*/
public function get($name) {
$data = $this->configStorage->read($name);
if ($data === FALSE) {
// For a typed config the data MUST exist.
$data = [];
trigger_error(new FormattableMarkup('Missing required data for typed configuration: @config', [
'@config' => $name,
]), E_USER_ERROR);
}
return $this->createFromNameAndData($name, $data);
}
Loading