Problem/Motivation

We need to use getKey() method of the entity definition to get entity keys like "id" and "bundle" instead of hardcoding them.

Steps to reproduce

Try to convert the bundle of the comment - you will see the error "id column not found in table comment"
as "id" of comment is "cid".

Proposed resolution

Use \Drupal::entityTypeManager()->getDefinition($entity_type)->getKey($entity_key) instead.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gilmord created an issue. See original summary.

gilmord’s picture

Assigned: gilmord » Unassigned
gilmord’s picture

Status: Active » Needs review
el1_1el’s picture

Version: 8.x-1.0-alpha6 » 8.x-1.x-dev
Status: Needs review » Fixed

I had a todo on this from long ago. Its been merged to the dev branch. Guess the merges dont come into the issues like patches used to? Reopen if you have any issues with the dev version

gilmord’s picture

Hi,

if you need a patch you can use a merge request url and add '.patch' at the end
In this case it will be: https://git.drupalcode.org/project/convert_bundles/-/merge_requests/2.patch

el1_1el’s picture

Thanks gilmord,

The commit is already there (https://git.drupalcode.org/project/convert_bundles/commit/4a26475) and it looks like you got issue credit (https://www.drupal.org/u/gilmord/issue-credits/2979087) and commit credit. I suppose I could ammend the commit message with the issue to get the old notification, but I dont think it would do much more. Just getting used to the new drupal.org process

Anyway, thanks for fixing that properly!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.