Active
Project:
Data
Version:
8.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2019 at 10:15 UTC
Updated:
14 Sep 2019 at 10:15 UTC
Jump to comment: Most recent
I use data_get_table($name) to load if table exits but there is fatal error
Error: Call to undefined method Drupal\data\Entity\TableConfig::defined() in data_get_table() (line 69 of modules/contrib/data/data.module)
method defined() isn't in entity tableConfig
but there is defined() in class Table \Drupal\data\Table
the code check should be
function data_get_table($name) {
$table = \Drupal::entityTypeManager()->getStorage('data_table_config')
->load($name);
// remove $table->defined()
if (!empty($table)) {
return $table;
}
return FALSE;
}
or
$table = new \Drupal\data\Table($name);
if ($table && $table->defined()) {
return $table;
}
Comments