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

[BUGFIX] Fix issue with type #592

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

sivaprasad1988
Copy link

Tasks:

  • Fix issue with type in backend preview

Tasks:
* Fix issue with type in backend preview
@sivaprasad1988 sivaprasad1988 changed the title [BUGFIX] Fix issue wit type [BUGFIX] Fix issue with type Mar 5, 2025
@chesio
Copy link

chesio commented Mar 5, 2025

I'm not a maintainer, but IMHO it's better to check whether the record actually comes from tt_content table (and bail early if it doesn't):

if ($event->getTable() !== 'tt_content') {
    return;
}

This is what official documentation recommends - see the event listener example here: https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Events/Events/Backend/PageContentPreviewRenderingEvent.html

@sivaprasad1988
Copy link
Author

@chesio Thank you for the feedback. I agree that adding this makes sense. However, even after checking it, I still see an error.

@achimfritz
Copy link
Contributor

Hi @sivaprasad1988 , when exactly do you see the error?, how can i reproduce this? (i will add the table check, as suggestet)

@sivaprasad1988
Copy link
Author

B13\Container\Tca\Registry::isContainerElement(): Argument #1 ($cType) must be of type string, null given, called in /var/www/typo3/releases/1.0.81/vendor/b13/container/Classes/Listener/PageContentPreviewRendering.php on line 33 (0).

@achimfritz this is what I get

Tasks:
* Check whether the record actually comes from tt_content table

Resolves: b13#591
@sivaprasad1988
Copy link
Author

@achimfritz I added the check

@achimfritz
Copy link
Contributor

ok, but when do you get this? (because i get this never?) (in my db definition the column CType is not nullable?)

@sivaprasad1988
Copy link
Author

sivaprasad1988 commented Mar 11, 2025

image
In the backend, the content element preview is not displaying correctly. I used content blocks to create custom content elements, and the issue occurs specifically with these custom elements. However, the preview works fine for standard content elements. @achimfritz

@achimfritz
Copy link
Contributor

ok, then it looks like an issue with content blocks for me.

@achimfritz achimfritz merged commit 3a75d0f into b13:master Mar 12, 2025
8 checks passed
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.

3 participants