Add media compatibility to content_kanban
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3110759. -->
Reported by: [kosa ilma](https://www.drupal.org/user/3435475)
Related to !20
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When I tried to use the Kanban with core media entities I got errors:</p>
<blockquote><p>Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS FROM media_field_data nfd INNER JOIN users_field_data ufd ON nfd. = ufd.uid ' at line 2: SELECT nfd.mid AS mid, nfd.name AS name, nfd.created AS created, nfd.status AS status, nfd.type AS type, ufd.name AS username, nfd. AS FROM {media_field_data} nfd INNER JOIN {users_field_data} ufd ON nfd. = ufd.uid WHERE (nfd.mid IN (:db_condition_placeholder_0)) AND (nfd.created >= :db_condition_placeholder_1) ORDER BY nfd.created ASC; Array ( [:db_condition_placeholder_0] => 51 [:db_condition_placeholder_1] => 1578137668 ) in Drupal\content_kanban\KanbanService->getEntitiesByEntityIds() (line 335 of /var/www/html/web/modules/contrib/content_planner/modules/content_kanban/src/KanbanService.php).</p></blockquote>
<blockquote><p>Notice: Undefined index: uid in Drupal\content_kanban\KanbanService->getEntitiesByEntityIds() (line 315 of /var/www/html/web/modules/contrib/content_planner/modules/content_kanban/src/KanbanService.php) #0 /var/www/html/web/core/includes/bootstrap.inc(596): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/html/w...', 315, Array) </p></blockquote>
<blockquote><p>Notice: Undefined index: uid in Drupal\content_kanban\KanbanService->getEntitiesByEntityIds() (line 313 of /var/www/html/web/modules/contrib/content_planner/modules/content_kanban/src/KanbanService.php) #0 /var/www/html/web/core/includes/bootstrap.inc(596): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/html/w...', 313, Array) </p></blockquote>
<p>The problem is that the media entity doesn't have 'uid' and 'type' entity_keys defined, but has 'owner' and 'bundle', which we can use.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Fixing the code to be compatible with core media entities too.</p>
issue