TYPO3 - Gridelements and nested flux content elements not visible in backend - typo3

Extension versions:
Flux: Fluid Integration - 9.3.2
Gridelements - 8.6.3
During an upgrade from 6.2 to 8.7.32, a website uses gridelements extension and Flux. We have some gridcontainers created with the gridelements extension and flux (CE's) nested inside these. Now the content elements are created but they don't get set properly inside the gridelement containers. Unless I create the flux elements outside the gridelement and then drag in inside.
In the database I can see that the fields are not properly assigned when created inside the gridelement:
Don't mind the typo, "Created outside parent container"
So that element with 0|0 on tx_gridelements_container and tx_gridelements_columns respectivly is not displayed in the backend and only visible in the list mode.
Now, this is strange because I checked the data types on the database and it seems alright. I had other similar pages that I've upgraded as well and no one had this issue after migrating to 8.7.32, since this issue only occurred in 6.2.x versions.
The allowed elements are set to all, as well as in the other TYPO3 where this issue is not occurring. Does anyone know what could I try to fix this? I'm running out of options and I couldn't find much at TYPO3 Slack, stack overflow and similars.

Are the necessary fields displayed in the editing form of those Flux elements?
To make Gridelements and their children work properly, you will need the Gridelements backend-layout, container and column fields defined for those elements. Otherwise they will get their default values, which is 0 in case of Gridelements.

Related

How to have multiple sections with images in a FluidTYPO3 flux form with TYPO3 10?

I have been using FluidTYPO3 (flux and vhs) to run TYPO3 web pages for many years now. With TYPO3 10, I face a major problem. I'll quickly write about my use case, how I solved it so far, and then what the problem with 10 LTS is.
Use case:
I want to have a content element template for a timeline using FluidTYPO3/flux. Each "point" on the timeline should have a heading, some text, and optionally some images. All in all, pretty basic (or so I thought).
Solution so far (TYPO3 <= 9):
Timeline elements are sections. Images are using flux:field.file.
Simplified example of the form:
<flux:form id="timeline" label="timeline">
<flux:form.section name="timeline" label="Timeline">
<flux:form.object name="element" label="Element">
<flux:field.input name="title" label="Heading" />
<flux:field.text name="label" label="Text" enableRichText="TRUE" />
<flux:field.file name="images" label="Pictures" allowed="jpg,png,svg" multiple="TRUE" maxItems="50" size="5" showThumbnails="TRUE"
/>
</flux:form.object>
</flux:form.section>
</flux:form>
With this, multiple elements can be created on the timeline and each of them can have its own set of images.
Problem in TYPO3 10:
The technology (TCA group fields to select files) that flux:field.file relies on was deprecated in TYPO3 9 and removed in TYPO3 10, see this notice. That is one of the reasons why flux:field.file was also marked deprecated and is going to be removed in TYPO3 10.
The TYPO3 deprecation notice says to use FAL relations instead. Of course, flux can also do this with flux:field.inline.fal. However, you can only have one FAL field per FlexForm. This precludes its usage in sections, since all sections would share the same images. This limitation is known for some time - see this bug report for example - but has never been fixed. It is also why I initially chose not to use FAL fields. Using bare file fields was the recommended workaround at the time.
Question:
So - how is everyone doing it? How to add multiple image fields to a flexform in TYPO3 10?
EDIT: More specifically, how to add an image field as part of a Flexform section that can contain multiple child records (resulting in multiple image fields)?
Note: I know that I can get a "file-like" field back by using an input field with inputLink renderType (like this), but as far as I can tell it does not allow to link multiple images.
I've found another workaround that might be appropriate for some use cases:
It is still possible to use flux:field.file fields if the useFalRelation parameter set to true, even on TYPO3 v10 LTS and in repeatable FlexForm sections. This will then put sys_file record IDs separated by comma into the field instead of raw filenames. They can be used as src argument for, e.g., f:image just as well as the filename, so the CE templates itself do not have to be modified. All existing CEs that had useFalRelation set to false need to be migrated though so that the filenames are replaced with sys_file UIDs.
This is a bit better than the inputLink workaround since it allows multiple images.
It seems the only workaround with TYPO3 core onboard methods is to go for a Flux-Container having a single column containing simple default "Text with image" or "text with media" elements and then to just ignore additional options of those elements and to just render the necessary fields.
With Gridelements this is called a "functional container", since the container determines the behaviour and appearance of those elements, while the elements themselves don't have to be custom elements at all.
Additionally this makes access to the content of those elements - i.e. while doing a search query - much easier.
The bug report you mentioned already contains the solutions, since the actual problem described there is that FAL fields in a flexform are using the same name.
So instead of
image
according to the bug report there should be
settings.foreground.image
which is of course not working, since the dot is part of the path but not of the name.
But actually replacing the dot with an underscore and using some suffixes within the same flexform tab should do the trick:
settings.foreground.settings_foreground_image
settings.foreground.settings_foreground_image2
This way you make sure that
The field names within your flexform are unique
The actual field name within the sys_file_reference entry already contains the full path information
You can use that information to fetch images i.e. within a DataProcessor and still know the FlexForm field they actually belong to
Sitll I would recommend to fully move away form FlexForms (and thus Flux too) in favor of "real" fields in the database table.
If you currently use the flux:field.file element at typo3 10 with the useFalRelation=1 you can replace it by the flux:field element. It is not deprecated and works in combination with the flux:form.object element
Following example:
<flux:field.file
allowed="jpg,png,svg,gif"
exclude="false"
label="MyLabel"
name="myname"
showThumbnails="1"
useFalRelation="1"
maxItems="1"
minItems="1"
/>
Can be replaced with:
<flux:field type="input" name="myname" label="MyLabel"
config="{
type: 'group',
size: 1,
internal_type: 'db',
use_fal_relation: 1,
allowed: 'sys_file',
maxitems: 1,
minitems: 0,
show_thumbs: 1,
appearance: {
elementBrowserAllowed: 'jpg,png,svg,gif',
elementBrowserType: 'file'
}
}
"/>

TYPO3 9.5.15 with gridelements and t3sbootstrap not working

I have a new TYPO3 9.5.15 installation and added gridelements 9.5.0 and t3sbootstrap 4.4.5 to make content elements with 3 columns in a own 1 column backendlayout which is defined in PageTsConfig.
In older TYPO3 versions, this is working fine (i.e TYPO3 7) but in TYPO3 9 I get the following error in FE:
Tried resolving a template file for controller action "Standard->three_columns" in format ".html", but none of the paths contained the expected template file (Standard/Three_columns.html). The following paths were checked:
xxx/typo3/sysext/fluid_styled_content/Resources/Private/Templates/, xxx/typo3conf/ext/gridelements/Resources/Private/Templates/, xxx/typo3conf/ext/t3sbootstrap/Resources/Private/Templates/Content/, xxx/typo3conf/ext/t3sbootstrap/Resources/Private/Templates/, ,
I've double checked and can confirm, that both, gridelements and t3sbootstrap are included in the roottemplate of the website.
As far as I found out, the templates are available in xxx/typo3conf/ext/t3sbootstrap/Resources/Private/Templates/Gridelements/
but are called ThreeColumns.html
Has anyone an idee what causes the error and how to resolve it?
Thanks in advance
At a first look it seems that there are 2 problems with your combination here:
The message "Standard->three_columns" points to a wrong static template, so I guess you included the new DataProcessing static of Gridelements, while t3sbootstrap depends on the old Plugin and USER based static.
The root path xxx/typo3conf/ext/t3sbootstrap/Resources/Private/Templates/Gridelements/ is missing in your setup.
At a second look it might even be enough to change the Gridelements static, since t3sbootstrap takes care of the root path based on that setup.

Import from tt_news with additional fields in tt_news and news (TYPO3 8 LTS)

import from tt_news in TYPO3 8 LTS with actual news and news_ttnewsimport is working fine. But we had some individual fields in tt_news and i want to import theese fields too in individuel fields in news.
So i made a new extension which extends news with individual fields. It is working fine: i can edit them in the backend and print content in the frontend.
Then i modified getImportData() in TTNewsNewsDataProviderService of news_ttnewsimport and added my new fields. The content of the individual fields of tt_news is fetched, i controlled it with a log-file. But the content was not written in the database ... I controlled the getter and setter in my configuration of news but all seems correct.
After some debugging i found that all commands which write the content in news are hardcoded in news/Classes/Domain/Service/NewsImportService.php:
$news->setAuthor($importItem['author']);
After adding my fields all works:
$news->setMyNewField($importItem['my_new_field']);
So my problem is fixed ... well some how: it seems dirty to change a class of an extension in order to handle individual fields.
Is there a correct possibility to make the import work with individual fields, without patching news?
Thanks!
In version 7 of tx_news i found the answer of my question ... i don't know wether it exists in older versions but in 7.1 it is possible to use a signal slot for this task:
link to the manual: Prehydrate slot

TYPO3: Duplicate content elements and fields after Flux 6.0.x update

Since updating from Flux 6.0.2 to the newest Flux TER-Release (7.0.0) I have the problem that all my defined flux:field.select items are switched. I have them defined as an array like this items="{0: {0: 'value shown as a CSS class in the frontend',1: 'value shown in BE'},}". But now I get the BE value in the frontend template.
Also all my content elements from my provider extension are shown twice (without a title) in the backend and the fields defined in the 'Configuration' section of my content element are shown twice.
There's also a RTE field shown at the bottom of my content element that has not been there before.
BE Output: view
Code on Pastebin: http://pastebin.com/CNcphn2k
Any help deeply appreciated.
EDIT:
I just set up a fresh instance of TYPO3 6.1.9 (blank package) and installed my extension with the above mentioned content elements. Dependencies were resolved automatically as it should (newest versions). Via the content wizard I tried to create a new element and I get the same result as in my existing install I first noticed this bug in.
EDIT2:
I was able to narrow it down to the flux:form.container tag. This duplicates the output in the BE. The select values are still switched though.
It is possible that you missed this official announcement:
http://fluidtypo3.org/blog/news/new-colpos-value.html
Failure to run the update script before letting TYPO3 change the type of the colPos value will result in the symptoms you describe. There is, unfortunately, no way to restore this (since your SQL will have cropped off all negative values and made them zero without any backup).
Restore from a backup and run the script and you should be fine.

Fluidpages Flux Configuration inheritance incomplete

I'm currently using TYPO3 6.1.8-dev to build a flux/fluidpages (GitHub Master) powered template and managed to have it running on the root pages, though, I have issues with the sub-pages, in terms of value inheritance.
I've implemented the following scenario:
A Flux Flexform Configuration is used, if there is no TypoScript override variable set, retrieved from TS Setup.
The Flexform fields have the following names:
gridsettings.topRow_use (checkbox)
gridsettings.topRow_cols (select)
After the Flexform Configuration, I use these fields to build the backend grid, after I mix in some static values of a TypoScript configuration with:
{v:iterator.merge(a:'{gridsettings}', b:'{tssettings}') -> v:var.set(name:'gridsettings')}
This works for every page with explicit settings in the page properties, but not for sub-pages, which should just inherit the parents settings.
In the case of sub-pages the gridsettings array is null, and only my TS settings are visible.
I'd like to have the convenience to just create a new sub-page, and add content to the inherited backend-layout grid without any further interaction in the page settings.
How can I solve this issue?
Two parts to this:
1) To solve the problem that you manually must merge TS with FlexForm settings, use the prefix settings. in all your field names. This special, reserved variable name will be used by both Extbase and Fluid without requiring you to transfer it, and your FlexForm settings will be merged (on top of) your TS settings.
2) Inheritance requires the exact same page template on parent and child page, or that child page sets parent decides as option for which template to use. There could be other causes for failing inheritance (for example, the use of default on any of your fields - since you don't include your Flux form structure this is impossible to determine) but mismatching parent/child template is the most common. Also, make sure your Flux is up-to-date; there have been bugfixes recently related to inheritance.