Skip to content

[10.x] Fix for attributes being escaped on Dynamic Blade Components - #50471

Merged
taylorotwell merged 1 commit into
laravel:10.xfrom
pascalbaljet:10.x
Mar 12, 2024
Merged

taylorotwell merged 1 commit into
laravel:10.xfrom
pascalbaljet:10.x

Conversation

@pascalbaljet

Copy link
Copy Markdown
Member

I understand this is an edge case, but I'm extending the DynamicComponent class as I needed some helper methods there:

use Illuminate\View\DynamicComponent;

class CustomComponent extends DynamicComponent
{
    // custom helper methods...
}

Since v10.48, it fails to pass attributes. This code snippet results in Argument #1 ($name) must be of type string, null given:

<x-custom-component :component="$componentName" :name="$name" />

The attributes are filtered out in attributesToStringWithExistingComponentData() (see #50403), except for Dynamic Components. However, it only checks for the exact class name, not for subclasses of DynamicComponent. This PR fixes that.

@taylorotwell
taylorotwell merged commit 40c32ce into laravel:10.x Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants