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

Fluent: “Could not find a react component for field...” when using inline publish action #1266

Open
2 tasks done
kinglozzer opened this issue Nov 5, 2024 · 6 comments

Comments

@kinglozzer
Copy link
Member

Module version(s) affected

5.3.0

Description

I have a non-inline-editable block that’s translatable via Fluent. If I click to edit the block, then publish, everything is fine. However if I edit the block and save draft, then go back to the element area and use the inline "publish" option for that block (via the popup menu) then I get the following error:

Uncaught Exception LogicException: "Could not find a react component for field "PageElements_495_RecordLocales".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

Shows in the CMS as “Error displaying the edit form for this block” toast popup.

I’ve not done any debugging at this stage, so I’m not sure if inline editing works with Fluent at all (I suspect not). Not sure why the inline publish action needs to load the inline edit form, I suspect that’s where the issue arises.

How to reproduce

Use fluent with elemental, set up a block to be translatable and not inline editable. Edit the block, save as draft. Go back to edit the page, open the actions popup menu against the “modified” block, click Publish.

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

Not sure why the inline publish action needs to load the inline edit form, I suspect that’s where the issue arises

That's almost certainly where the problem is, yeah.
IIRC that changed in CMS 5.3 (previously the block data was all in JSON I think?) - the change was done to allow inline-editable validation to work, but this effect on non-inline-editable blocks wasn't expected.

@emteknetnz did I get that right?

@emteknetnz
Copy link
Member

Marked as medium impact because while inline publishing individual blocks is broken in this scenario, there's a workaround available to publish the whole page in order to publish the block.

previously the block data was all in JSON I think?

I'm not sure what that means

the change was done to allow inline-editable validation to work, but this effect on non-inline-editable blocks wasn't expected.

That's correct

@GuySartorelli
Copy link
Member

GuySartorelli commented Nov 6, 2024

previously the block data was all in JSON I think?

I'm not sure what that means

I think in 5.2 and earlier, all blocks had all of their data in JSON loaded onto the page somewhere (which facilitated saving blocks by saving the page, but I think might have also used to power inline-publishing of non-inline-editable blocks)

@GuySartorelli
Copy link
Member

Marked as medium impact because while inline publishing individual blocks is broken in this scenario, there's a workaround available to publish the whole page in order to publish the block.

I'd say the better workaround is to load the edit form for the block and publish it from there. But either way, I agree with the impact assessment as there's an easy workaround.

@emteknetnz
Copy link
Member

I think in 5.2 and earlier, all blocks had all of their data in JSON loaded onto the page somewhere (which facilitated saving blocks by saving the page, but I think might have also used to power inline-publishing of non-inline-editable blocks)

Oh yes that's correct

Part of the changes in 5.3 is that it effectively will inline save all blocks on page save. We removed the inline html blob that was used to save the inline editable blocks on page.

This means the the impact might be high if it's possible to totally block page saving

@kinglozzer what happens when you just click the page publish button?
a) if you didn't previously edit the non-inline editable block
b) if you did previously edit the non-inline editable block

@kinglozzer
Copy link
Member Author

@emteknetnz that still works as expected (draft changes are published), presumably that’s running via the $owns API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants