DefaultTableMapping::getFieldColumnName() returns wrong values for reserved columns

Created on 9 May 2019, over 5 years ago
Updated 6 March 2023, almost 2 years ago

Problem/Motivation

\Drupal\Core\Entity\Sql\DefaultTableMapping::getReservedColumns() defines only deleted as a reserved column, but fields storage in dedicated tables have a lot more: bundle, entity_id, revision_id, langcode and delta.

This means that calling getFieldColumnName($storage_definition, 'entity_id') on a field stored in a dedicated table returns {$field_name}_entity_id instead of just entity_id.

Proposed resolution

Make DefaultTableMapping::getReservedColumns() return all reserved columns.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.

πŸ› Bug report
Status

Needs work

Version

9.5

Component
EntityΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡·πŸ‡΄Romania amateescu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    @ranjith_kumar_k_u please include an interdiff with patches.

    Reviewing the patch and it has valid test coverage and looks good.

    Will let the committers decide but since getReservedColumns() is returning more values now will that require a change record?

  • Status changed to Needs work almost 2 years ago
Production build 0.71.5 2024