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

Invalid TCA internal_type of field "field_image" in table tt_content: Must not be set, or set to "folder". #488

Open
derBoogie opened this issue Mar 2, 2023 · 10 comments
Labels
Milestone

Comments

@derBoogie
Copy link

After the update to TYPO3 11.5 and TV+ 8.1.2 the following error occurs when editing an FCE with image fields:

Invalid TCA internal_type of field "field_image" in table tt_content: Must not be set, or set to "folder".

Here is the corresponding XML-configuration:

...
<el type="array">
	<field_image type="array">
		<TCEforms type="array">
			<label></label>
			<config type="array">
				<type>group</type>
				<internal_type>file</internal_type>
				<allowed>gif,png,jpg,jpeg,svg</allowed>
				<max_size>1000</max_size>
				<uploadfolder>uploads/tx_templavoila</uploadfolder>
				<size>1</size>
				<maxitems>1</maxitems>
				<minitems>0</minitems>
			</config>
		</TCEforms>
		<type>element</type>
		<title>Bild</title>
	</field_image>
</el>

How can I fix this?

@opi99
Copy link
Collaborator

opi99 commented Mar 5, 2023

This was discussed the days on the TYPO3 TemplaVoila+ slack channel. I didn't recognized this issue, cause I migrated to FAL already. So this is missing yet and I need to add this functionality as group-file isn't supported anymore by TYPO3 Core

@derBoogie
Copy link
Author

derBoogie commented Mar 5, 2023

This was me on the TemplaVoila+ slack channel.

Here is the migration of the image field date structure XML to FAL:

<el type="array">
	<field_image type="array">
		<TCEforms>
			<label>Bild</label>
			<config>
				<type>inline</type>
				<maxitems>1</maxitems>
				<foreign_table>sys_file_reference</foreign_table>
				<foreign_table_field>tablenames</foreign_table_field>
				<foreign_label>uid_local</foreign_label>
				<foreign_sortby>sorting_foreign</foreign_sortby>
				<foreign_field>uid_foreign</foreign_field>
				<foreign_selector>uid_local</foreign_selector>
				<foreign_selector_fieldTcaOverride>
					<config>
						<appearance>
							<elementBrowserType>file</elementBrowserType>
							<elementBrowserAllowed>gif,jpg,jpeg,png,svg</elementBrowserAllowed>
						</appearance>
					</config>
				</foreign_selector_fieldTcaOverride>
				<foreign_types type="array">
					<numIndex index="0">
						<showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
					</numIndex>
					<numIndex index="2">
						<showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
					</numIndex>
				</foreign_types>
				<foreign_match_fields>
					<fieldname>field_image</fieldname> <!-- This is the field name -->
				</foreign_match_fields>
				<appearance type="array">
					<newRecordLinkAddTitle>1</newRecordLinkAddTitle>
					<headerThumbnail>
						<field>uid_local</field>
						<height>100</height>
						<width>70</width>
					</headerThumbnail>
					<enabledControls>
						<info>1</info>
						<new>0</new>
						<dragdrop>0</dragdrop>
						<sort>1</sort>
						<hide>0</hide>
						<delete>1</delete>
						<localize>1</localize>
					</enabledControls>
					<createNewRelationLinkTitle>LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference</createNewRelationLinkTitle>
				</appearance>
				<behaviour>
					<localizationMode>select</localizationMode>
					<localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
				</behaviour>
				<overrideChildTca>
					<columns type="array">
						<uid_local type="array">
							<config type="array">
								<appearance type="array">
									<elementBrowserType>file</elementBrowserType>
									<elementBrowserAllowed>jpg,png,svg,jpeg,gif</elementBrowserAllowed>
								</appearance>
							</config>
						</uid_local>
					</columns>
					<types type="array">
						<numIndex index="2">
							<showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
						</numIndex>
					</types>
				</overrideChildTca>
			</config>
		</TCEforms>
	</field_image>
</el>

and the corresponding typoscript mapping configuration:

10 = FILES
10 {
	references {
		table = tt_content
		uid.data = TSFE:register|tx_templavoilaplus_pi1.parentRec.uid
		fieldName = field_image
	}
	renderObj = IMAGE
	renderObj {
		file {
			import.data = file:current:publicUrl
			width = 567
			height = 360c
		}
	}
}

@opi99
Copy link
Collaborator

opi99 commented Mar 5, 2023

Ahh, ok, fine, thanks for your input.
We need a migration of the files to the correct location together with the entries in sys_file_reference.

As note to your TypoScript, you have a FAL object, retries the publicUrl to import it and retrieve the FAL object from this publicUrl (Browser) on the local file system. This works as long as you have an absolute and a local FileStorage.

You should be able to use import = file:current, which uses the FAL object directly (I do not find correct examples yet and I'm not on my working machine).

@opi99 opi99 added the Feature label Mar 22, 2023
@opi99 opi99 added this to the 8.2.0 milestone Mar 22, 2023
@gregordonsky
Copy link
Contributor

I think this should be the typoscript without using publicUrl

10 = FILES
10 {
	references {
		table = tt_content
		uid.data = TSFE:register|tx_templavoilaplus_pi1.parentRec.uid
		fieldName = field_image
	}
	renderObj = IMAGE
	renderObj {
		file {
			import.data = file:current:uid
                        treatIdAsReference = 1
			width = 567
			height = 360c
		}
	}
}

@arappel
Copy link

arappel commented Aug 3, 2023

Hello,

I'm embedding TemplaVoila like this

page = PAGE
page.typeNum = 0
page.10 = USER
page.10.userFunc = Tvp\TemplaVoilaPlus\Controller\Frontend\FrontendController->renderPage
page.10.disableExplosivePreview = 1

Where do I have to put the typoscript you posted above to work around the issue (sorry, I'm a rookie)?

The XML works but the image is not rendered in the frontend.

Thanks and kind regards

@opi99
Copy link
Collaborator

opi99 commented Sep 20, 2023

Hi @arappel

this needs to be done inside the Mapping Configuration for the field.

Example (but with another TypoScript): https://github.com/T3Voila/t3voila_uikit/blob/main/Resources/Private/Mappings/Content/Accordeon.tvp.yaml#L26

@opi99 opi99 closed this as completed Sep 20, 2023
@opi99 opi99 reopened this Sep 20, 2023
@opi99
Copy link
Collaborator

opi99 commented Sep 20, 2023

Excuse, the migration of the file field is still an issue.

@opi99
Copy link
Collaborator

opi99 commented Mar 15, 2024

@derBoogie
Copy link
Author

Oh, there was never a core migrator for this https://github.com/TYPO3/typo3/blob/9.5/typo3/sysext/core/Classes/Migrations/TcaMigration.php#L2591

Can you provide this in the next version (for TYPO3 11 and 12)?

@opi99
Copy link
Collaborator

opi99 commented Mar 15, 2024

@derBoogie Did you need to update more, then only the XML of the DataStructure? Or do we need to migrate also the files? (I've no old installation here, so I don't know, how this was saved inside the database).

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

No branches or pull requests

4 participants