Skip to content

Renderlet editable API call drops custom config parameters #3325

@Maxara

Description

@Maxara

The renderlet-content.tsx component correctly builds apiParams including all custom config keys from the renderlet editable's configuration (via ...omit(config, [...])):

 // renderlet-content.tsx lines 49-57                                                                                                                                                 
  const apiParams = shouldFetchRenderlet                                                                                                                                               
      ? {
          id: value.id!,                                                                                                                                                               
          type: value.type!,                                                                                                                                                         
          controller: config.controller,
          parentDocumentId: documentId ?? undefined,                                                                                                                                   
          template: config?.template,
          ...omit(config, ['controller', 'template', 'className', 'height', 'width', 'reload', 'title', 'type', 'class'])                                                              
        }                                                                                                                                                                              
      : undefined

However, the documentRenderletRender RTK Query endpoint in document-api-slice-enhanced.ts only forwards 5 hardcoded params, ignoring all custom ones:

  // document-api-slice-enhanced.ts lines 91-96                                                                                                                                        
  params: {                                                                                                                                                                          
      id: arg.id,                                                                                                                                                                      
      type: arg.type,
      controller: arg.controller,                                                                                                                                                      
      parentDocumentId: arg.parentDocumentId,                                                                                                                                        
      template: arg.template
  }

This means custom renderlet parameters like additionalData, selectedTemplate, selectedSorting, editmode, cssClasses, etc. never reach the backend controller. The backend
RenderController already supports these — it passes $request->query->all() through to the rendered action.

Expected: All params from apiParams should be forwarded as query parameters to the API.

Suggested fix: Replace the hardcoded params with the full arg object:
params: arg

Workaround: Override the endpoint via api.injectEndpoints({ overrideExisting: true }) in a custom plugin.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions