Overview

I used Claude Code to create an SDC from a Loveable design and it made a `logo_url` prop with the shape of:

{"type":"string","contentMediaType":"image/*","format":"uri-reference"}

I changed it to be a lot so I could place the branding block, then cleared caches.

But the component is still incompatible for the same reasons.

I used `drush config:get` to get the component config... and it was correct and generated without the `logo_url` prop and `status: true`

And I can find it in the components panel to add to my site still

Proposed resolution

Make sure reasons are synchronized properly.

    // All other components:
    // 1. create a Component config entity if it does not exist yet, or
    // 2. if the computed settings changed, create a new version on the existing
    // 3. if other metadata changed, update it (no new version!)
    foreach ($eligible_component_ids as $source_specific_component_id) {

purge reasons here

updateReasons isn't really used because we always call storeReasons

User interface changes

Issue fork canvas-3585530

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

mglaman created an issue. See original summary.

mglaman’s picture

Component: … to be triaged » Component sources
Status: Active » Needs review

penyaskito’s picture

Status: Needs review » Needs work
Issue tags: +Drupal CMS release target

As you mentioned, this would be an issue when disabling through recipes.

I'd rather change the flow: If you manually (or via a recipe) enable a component that was disabled, we should attempt to clear the reasons before affecting that component.
Isn't that the case already?

We will need explicit tests with recipes. Getting this wrong would be a huge annoyance (or even a blocker regression) for Drupal CMS and the site templates out there.

mglaman’s picture

I removed the part about enabling a component automatically. The UI doesn't provide a way to enable a component that is incompatible, which is what lead me down this route.

The DX was extr awkward without performing a site reinstall

banoodle’s picture

This MR works for me. Without it, I'm still seeing SDC components listed as incompatible, even after I fix them.

With the patch, corrected SDCs are removed from the incompatible list once I correct them and flush caches.

Thank you!

mglaman’s picture

Status: Needs work » Needs review

Added a recipe test

mglaman’s picture

Assigned: Unassigned » penyaskito

PR approved but I want penyaskito to give a second look

wim leers’s picture

Nice! 😊 Just one Q.

(And what a silly/stupid gap!