Problem/Motivation

Let's challenge this part of in https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...

        // All props should also support "object" this allows deferring
        // rendering in Twig to the render pipeline.
        $type = $prop_schema['type'] ?? '';
        $schema['properties'][$name]['type'] = array_unique([
          ...(array) $type,
          'object',
        ]);

Proposed resolution

Remove this. Check if the tests are still OK.

Issue fork drupal-3554720

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

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Needs review

Needs review

pdureau’s picture

Issue summary: View changes
Issue tags: -11.3.0 release priority

Remove "11.3.0 release priority" tag because it is not blocking #3352063: Allow schema references in Single Directory Component prop schemas anymore and can be merged after 11.3 if we need more time.

shubham_pareek_19’s picture

Assigned: Unassigned » shubham_pareek_19

reviewing it.

pdureau’s picture

Thanks @shubham_pareek_19

I will also ping the original author of this snippet to have its opinion and maybe some information about the context of this addition.

pdureau’s picture

Some information from Mateu, the original author (not a proper quote):

it was maybe added in order to accommodate how Drupal can pass a render array in place of any type of data with the intent that it will be rendered down the line. I may be a remnant of the early days CL Components (the ancestor of SDC), when there was no slots yet, only props, so we needed a way to pass renderables in props.

Today, we have slots and we don't pass renderables in props. That may be the reason why this mechanism looks ok to be removed. Anyway, we need to be careful.

smustgrave’s picture

Status: Needs review » Needs work

Think it needs a rebase based on the composer changes in the diff

pdureau’s picture

Assigned: shubham_pareek_19 » pdureau

Weird. Because I don't think I have changed the composer files

Ah ok, it is because I have created the branch from 11.3.x but I am targeting 11.x. OK, I rebase

pdureau’s picture

Version: 11.3.x-dev » 11.x-dev
pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Needs review
geek-merlin’s picture

Status: Needs review » Needs work

I have objections, likely remediable. No time now but promise will schedule time tommorrow.

shubham_pareek_19’s picture

@geek-merlin i have tested this MR this works fine for me. Waiting for your input.

thankyou.

geek-merlin’s picture

OK, i needed to read the source in order to really grok it. If i get it right, it's removes an obsoleted internal type hack, so my +1 for that.

Review: Code looks straightformward: Remove that hack, adjust tests.

I would RTBC that.

Strange JS test failure though - https://git.drupalcode.org/issue/drupal-3554720/-/jobs/7076303
NW for that. Or to scrutinize and confirm unrelated (can be RTBCed then imho).

shubham_pareek_19’s picture

Status: Needs work » Reviewed & tested by the community

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new786 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

pdureau’s picture

Status: Needs work » Needs review
Issue tags: +Chicago2026

It was RTBC, the rebase went fine, so back to "Needs review"

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Restoring status!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

I think this looks fine and conceptually correct but I think we should cover ourselves with a CR. If someone does want an object here then they'd have to add it to their schema right? Setting to needs work to add the CR.

pdureau’s picture

Assigned: Unassigned » pdureau

If someone does want an object here then they'd have to add it to their schema right?

Right. Drupal must work with the schema authored by the component owner. It is not taboo to do some alteration Drupal side, we are already doing it with meta:enum for example, but let's try to avoid this when we can.

Setting to needs work to add the CR.

On it.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record

  • catch committed a9376ed9 on 11.x
    task: #3554720 Remove addition of a object type in all props
    
    By:...

  • catch committed 411e46bd on main
    task: #3554720 Remove addition of a object type in all props
    
    By:...
catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

This looks good, thanks for the investigation into how this originally came to be. Forgot to credit @eoipso in the commit message but have credited on the contribution record.

Committed/pushed to main and 11.x, thanks! Updated the CR versions to 11.5 and published it with a couple of minor copy edits.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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