Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a react component for field "PageElements_172_CustomItems" #1326

Closed
2 tasks done
adrian-stein opened this issue Mar 3, 2025 · 3 comments
Closed
2 tasks done

Comments

@adrian-stein
Copy link

adrian-stein commented Mar 3, 2025

Module version(s) affected

5.3.9

Description

I just upgraded my SS4 project to SS5 and I am now using SS 5.4 and elemental 5.3.9. When I click on elements to edit them ( the page and elements are already published and the content was copied over) ( or open the drop down to slide it open) I get the below error.

Uncaught Exception LogicException: "Could not find a react component for field "PageElements_172_CustomItems".Replace or remove the field instance from the field list, or update the field class and set the schemaDataType or schemaComponent property." at \vendor\silverstripe\framework\src\Forms\Schema\FormSchema.php line 129 {"exception":"[object] (LogicException(code: 0): Could not find a react component for field \"PageElements_172_CustomItems\".Replace or remove the field instance from the field list, or update the field class and set the schemaDataType or schemaComponent property. at \\vendor\\silverstripe\\framework\\src\\Forms\\Schema\\FormSchema.php:129)"} []

Some of my elements work but it appears to maybe be elements that have data grids on them that may be causing issues.

If I go directly to /admin/pages/edit/EditForm/137/field/ElementalArea/item/469/edit/ then the page loads of fine, it just when it tries to display the element on the page itself.

I notice this is the same if to similar but #1266

Any ideas to fix this or a work around that will make it work?

How to reproduce

To reproduce click on element that has a data grid on it

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
@GuySartorelli
Copy link
Member

This isn't a bug, it's working as expected as per the 5.2.0 changelog.

Some of my elements work but it appears to maybe be elements that have data grids on them that may be causing issues.

GridField cannot be rendered in a react form. You'll need to remove and GridField from your inline-editable elemental blocks.

I am now using SS 5.4

Do not use that until it is stable, unless you are using the relevant 5.4 releases for all modules, including elemental.

@GuySartorelli GuySartorelli closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2025
@adrian-stein
Copy link
Author

What if I need a gridfield on the block, how do I get around this error? Is there a way to make the element open in a new tab when editing instead of editing it inline? This is what older versions of elemental did which is why I assume it was not an issue until now.

@GuySartorelli
Copy link
Member

GridField does not work in an inline editable block. Before it was just erroring silently by not rendering the field, but it still didn't give you the field when inline editing.

Is there a way to make the element open in a new tab when editing instead of editing it inline?

As per https://docs.silverstripe.org/en/5/optional_features/elemental/defining-you-own-elements/#in-line-editing set inline_editable to false.

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

No branches or pull requests

2 participants