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

Problems while migrating form Fluidcontent #1542

Closed
MediKathi opened this issue Apr 11, 2018 · 28 comments
Closed

Problems while migrating form Fluidcontent #1542

MediKathi opened this issue Apr 11, 2018 · 28 comments

Comments

@MediKathi
Copy link

Hello,

while migrating from Fluidcontent to Flux I have found som issues:

Test with: Flux: 8.2.1
The BackendRendering works fine but:
The FrontendRendering is broken, I get "ERROR: Content Element with uid "82" and type "flux_twocolumns" has no rendering definition!"

Test with: Flux: 8.2.1 (Dev-Branch)
The BackendRendering works, but all the label are not longer translated: they have all thier 'name' attribute as label not the translation form the locallang.xlf
The Frontend resturns:
Could not analyse class: "Tx_MyExt_Controller_ContentController"
But the class exists.

With Fluidcontent 5.2.0 and Flux 8.2.1 (stable) everything works as intended.

Is there a "State of the Art" example Project for FluidTypo3 ?

My Current Setup:

Typo3: 8.7.12
Fluidpages: 4.1.0
vhs: 4.4.0

@Geddo
Copy link

Geddo commented Apr 11, 2018

Have the same problem after merging from flux-master to flux-dev. Figured out that my Grouping doesnt work anymore:
<flux:form id="cardnumber" options="{group: 'Flexible Content Elements'}">
[EDIT - rest was nonsense :-D ]

@MediKathi
Copy link
Author

for the groups you can maybe try:
<flux:form.option.group value="myGroup" />
within the form tag

@Geddo
Copy link

Geddo commented Apr 11, 2018

Doesnt work for me. Does it work for you?

@MediKathi
Copy link
Author

the sorting works, but the rendering in the frontend not.

here is a working example for the grouping

<f:section name="Configuration">

	<flux:form id="TwoColumns">
		
		<flux:form.option.group value="common test" />
		<flux:form.option.icon value="/typo3conf/ext/myExt/Resources/Public/Icons/Content/TwoColumns.png" />			
		
		<flux:field.checkbox name="reverseMobileFlow" />
		<flux:field.checkbox name="spaceBetween" />	
    <flux:field.select name="colwidth" items="L33_R66,L66_R33,L50_R50" translateCsvItems="1" maxItems="1"/>
      
	<flux:grid>
    <flux:grid.row>
        <f:if condition="{colwidth} == 'L33_R66'">
	        <flux:grid.column name="Col1" style="width:33%;"/>
	        <flux:grid.column name="Col2" style="width:67%;" />
        </f:if>
        <f:if condition="{colwidth} == 'L66_R33'">
	        <flux:grid.column name="Col1" style="width:67%;"/>
	        <flux:grid.column name="Col2" style="width:33%;" />
        </f:if>
        <f:if condition="{colwidth} == 'L50_R50'">
	        <flux:grid.column name="Col1" style="width:50%;"/>
	        <flux:grid.column name="Col2" style="width:50%;" />
        </f:if>
    </flux:grid.row>
	</flux:grid>
	    
	    
	</flux:form>

</f:section>

@Geddo
Copy link

Geddo commented Apr 11, 2018

thanks. Doesnt work for me anyway. Tab-Name is just "-" no matter how my groupname is

@breakone
Copy link

Use a language file instead, e.g.:

<flux:form.option.group value="slider" />

and in the language file:

...
<trans-unit id="flux.newContentWizard.slider"><source>Slider</source></trans-unit>
...

@yol
Copy link

yol commented Apr 15, 2018

Tab-Name is just "-" no matter how my groupname is

#1524

@MediKathi
Copy link
Author

any ideas how to fix the frontend rendering?

@breakone
Copy link

breakone commented Apr 19, 2018

do you register the content provider in your extensions ext_localconf.php?

e.g.:

\FluidTYPO3\Flux\Core::registerProviderExtensionKey('Vendor.TestExtension', 'Content');

https://fluidtypo3.org/documentation/templating-manual/templating/provider-extension/registration-in-php.html

@MediKathi
Copy link
Author

Yes I register the content provider

i got the same result with:
\FluidTYPO3\Flux\Core::registerProviderExtensionKey('Dm.DmLayout', 'Content');
and
\FluidTYPO3\Flux\Core::registerProviderExtensionKey($_EXTKEY, 'Content');
Both solution:
ERROR: Content Element with uid "123" and type "dmlayout_twocolumns" has no rendering definition!

the ContentController looks like:

`<?php
namespace Dm\DmLayout\Controller;

use FluidTYPO3\Flux\Controller\ContentController as AbstractController;

/**

  • Content Controller
  • @route off
    */
    class ContentController extends AbstractController {

}`

@NamelessCoder
Copy link
Member

Pay attention to the CType that results from using Flux or Fluidcontent respectively. Your content types should be possible to insert and if you create a new one, you can read the CType value from the database. Then to migrate, perform SQL queries to update any old records to get the new and correct CType.

@MediKathi
Copy link
Author

Elements that I create with the new CType results in
"ERROR: Content Element with uid "82" and type "myext_twocolumns" has no rendering definition!"
So elements can be Created well and all the Stuff works in the Backend, but not in the Frontend

@NamelessCoder
Copy link
Member

Do you have a content rendering extension installed as well, e.g. css_styled_content or fluid_styled_content? Do you include their static TS before the TS from your extension and do you include it by selecting it in a root TS template in the "Include static from extensions" field? If it is not included this way, the loading order of TS will be incorrect (those extensions are specially marked by the TYPO3 core to load TS as early as possible in order to guarantee that TS object tt_content exists).

If you included the TS from such extensions by any other means, it may load after Flux TS and result in the "No rendering definition" error for everything that's not a core CType.

@MediKathi
Copy link
Author

I use fluid_styled_content and it template is loaded first.
With fluidcontent everything works fine

@MediKathi
Copy link
Author

It is still not working:

  • The ContentController is there
  • The Controller is registred
  • The TypoScripts are loaded (Fluid_styled_content and my own Extension)

Is there a working Example or is a certain Flux version required?

@NamelessCoder
Copy link
Member

@MediKathi Judging from the two different error messages you get, it really looks like you might have an earlier version of Flux which can still assume the flux_myctype format of CType. If you make sure that you're on dev-development (note: not master which is identical to latest TER release) you absolutely should see a different result. On that branch, the CType should always be myext_ctype (so, your extension key, mangled, as prefix - never flux_) so if you make sure your records match this, or you remove all and create new, I definitely expect it to work.

@MediKathi
Copy link
Author

After some testing i could find out:

If I use the current dev-branch version, and clean all Caches (including the Server caches (restart Apache)), it works. The Frontend renders as expectet and I can make Content-Elements with the corret CType (myext_myelement).
But this leads into an new problem.

The translation seams to be broken:
{f:translate(key:'mykey')} is still working, but {v:l(key: 'mykey')} results in "Parameter $extensionName cannot be empty if a fully-qualified key is not specified. "
I think this could be the reason why something like <flux:field.select name="mobileBehavior" items="normal,keep,hideLeft,hideRight" translateCsvItems="1" maxItems="1"/> is not beeing translated in the backend. the Dropdown has the Label "mobileBehavior" and the all options are shown as "mobileBehavior".

@MediKathi
Copy link
Author

After just installing the newst Flux-Devbranch error "Parameter $extensionName cannot be empty if a fully-qualified key is not specified. " appears. No other changes are done, then updating Flux.

@rupasix
Copy link
Contributor

rupasix commented Jun 22, 2018

If I recall correctly, i've had that error when i've installed flux-dev not in default directory (./typo3conf/ext/flux).

@MediKathi
Copy link
Author

it is in this directory

@lukastaferner
Copy link

Hi @MediKathi , same issue here after uninstalling fluidcontent the Frontend is broken (ERROR: Content Element type "flux_XY" has no rendering definition!). In the backend TS:tt_content.flux_XY shows up and has a USER configuration. If I create new Content Elements in the backend they show up as flux_XY as well. Any updates / solutions?

@MediKathi
Copy link
Author

Now I have done the following:

I downloaded the latest version of vhs, flux and fluidpages from the TER

  • Typo3 8.7.13

  • vhs 5.0.1

  • flux 9.0.1

  • FluidPages 4.2.0

I use this in my Local Conf:
\FluidTYPO3\Flux\Core::registerProviderExtensionKey('Dm.DmLayout', 'Content');

And this in my ContentCntroller.php:
namespace Dm\DmLayout\Controller;
use FluidTYPO3\Flux\Controller\ContentController as AbstractController;
Its just the an emtpy Controller class.

After adding some colPos numbers in my flux:grid, the thing works in the backend. BUT! the Preview section does not show any Translaton. Rahter for the grid or {f:translate(key: 'flux.TwoColumns')} (this key exists in the locallang.xlf).

The Frontendrendering works, even without colpos.
<flux:content.get area="{area}" as="elements" render="false"> returns the Elements like before.
{area} is a sting given in: <flux:grid.column name="Col1" colPos="1" style="width:33%;"/> (Configuration Section)

the only problem left is the broken Translation in the Preview Section.

The backend returns 8101 (content id and colpos), but it should return the value of the key 'flux.TwoColumns.columns.Col1' (locallang.xlf). There are also a broken colPos Dropdown (like #1593) but wihout the invalid value, it just shows the options (with the colpos and without any label).

Summary

  • Logic works
  • No Translations in the Preview Section (f:translate)
  • No Translations for the grid (colpos id is visible not the label from the locallang.xlf)
  • No colPos Dropdown Translations

@outdoorsman
Copy link
Contributor

For those still migrating from fluidcontent to flux, here's a helpful discussion on the SQL one person used.

https://stackoverflow.com/questions/50755107/typo3-database-migration-from-fluidcontent-to-flux

@NamelessCoder NamelessCoder pinned this issue Oct 10, 2019
@NamelessCoder
Copy link
Member

Closing issue; it will remain pinned though. Thanks everyone for all the info and scripts you added here!

@felixrupp
Copy link

Hey @NamelessCoder

sorry to open this up again, but I have issues after upgrading a TYPO3 7 to 8.7 LTS and migrating from fluidcontent to flux only. I have several setups with TYPO3 8 and 9 with flux and fluidpages from scratch, which all work flawlessly.

But I can’t get the migration process on this one done. I upgraded the core, ran the database analyzer to add the flux migration field (not removing any of the old ones, ran the extension updates, ran the flux update script, which is not converting anything (0 records, why?)

I converted the CType manually with the sql statements in the link posted by @outdoorsman (https://stackoverflow.com/questions/50755107/typo3-database-migration-from-fluidcontent-to-flux/50759394#50759394). The records appear in the backend again, but all the content in my custom flux grid columns is still missing. Page Layout and Backend Appearance are set and working.

I followed the link in the stackoverflow discussion (https://stackoverflow.com/questions/55183681/typo3-database-migration-from-fluidcontent-to-flux-goes-wrong) and tried several approaches to change the colPos value, but I can’t find a way to correctly convert them. The colPos has always been set correctly in the Flux template, so there is no information missing in the records (as far as I can see).

Why is the flux update script not doing it’s work?

Do you have any guide or list on what to exactly do after upgrading like this?

Thanks for your help.

Regards,
Felix

@NamelessCoder
Copy link
Member

Hi @felixrupp,

Aside from the migration wizard itself it seems you've already found the information that is required for migration. The only step to perform manually is the CType conversion, since Flux can't guess the right CType for all possible CType values.

If you have trouble making the conversion work then it could just be the sequence in which you performed the steps. The first thing you need to do is make sure that you update the template files according to the requirements of the Flux version - this should be easy enough to test if you create a new instance of the content element type before you convert to existing instances, to confirm that the adjusted template works with child records. Once you've confirmed it works, and you corrected the CType values in DB you should be able to run the migration wizard through Extension Manager; it will warn you about things like colPos value being within working range (0-99) and should report any "hard" template syntax errors such as missing required ViewHelper arguments or using arguments that were removed.

If you need to re-run the migration you can always zero out the value of tt_content.tx_flux_migrated_version - once a value is set here the records will be ignored and the migration wizard will be unavailable if there are no non-ignored records, but resetting it makes it possible to re-migrate any records that may have failed to migrate, for whatever reason.

Hope this helps!

@felixrupp
Copy link

Hi @NamelessCoder

thanks for your answer, I actually managed to get it working now. To sum up, I did the following.

  1. Updated flux and fluidpages to the latest version for TYPO3 8 and removed fluidcontent. Flux got the update from flux 8 to 9, which needs a migration. Applied all updates in the Database Upgrade Wizard in install tool, but didn’t remove any old fields or tables yet.

  2. I selected the correct Page Layout and Backend Layout in the rootpage settings of my pagetree.

  3. Added:

<flux:field.input name="settings.placeholder" displayCond="FIELD:settings.placeholder:=:1" />

in the form-tag of my Page-Template (see below for full example) to fix the Page Configuration-Tab.

  1. Then I updated the CType column with the SQL-Statement provided in the stackoverflow discussion:
UPDATE tt_content 
 SET CType = LOWER(REPLACE(REPLACE(tx_fed_fcefile, 'Your.Extkey:', 'extkey_'), '.html', ''))
 WHERE CType = 'fluidcontent_content';

(be aware, that you have to change your company and extension identifier and change the new prefix to the key of your extension without the company)

  1. Then I updated the colPos attributes with the following SQL-statement, also provided by stackoverflow users. As I have more than one possible column in my grid setup, this has to be executed for every column you have configured. I have a maximum of five columns (1-5 or one to five), where x is the colPos defined in your template’s flux:grid.column-tag and columnName is the corresponsing name:
UPDATE `tt_content` SET colPos = ((tx_flux_parent * 100) + x) WHERE tx_flux_column = "columnName";

That’s all I had to do. Hope this will help somebody with the migration.

Examples:

Step 3. Page-Layout configuration section:

<f:section name="Configuration">
    <flux:form id="standard">
        <!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:form tag -->

        <flux:field.input name="settings.placeholder" displayCond="FIELD:settings.placeholder:=:1" />

    </flux:form>
    <flux:grid>
        <!-- Edit this grid to change the "backend layout" structure -->
        <!-- your grid goes here […] -->
    </flux:grid>
</f:section>

Step 4. SQL-Statement to update the CType:

UPDATE tt_content 
 SET CType = LOWER(REPLACE(REPLACE(tx_fed_fcefile, 'Fr.Standardprovider:', 'standardprovider_'), '.html', ''))
 WHERE CType = 'fluidcontent_content';

Step 5. Example with my first column with the colPos 11 and the name one:

UPDATE `tt_content` SET colPos = ((tx_flux_parent * 100) + 11) WHERE tx_flux_column = "one";

@NamelessCoder
Copy link
Member

NamelessCoder commented Jun 15, 2020

Thanks for the detailed feedback @felixrupp, I'm sure this will help other users who may have the same problems as you did with migration. I have a couple of comments to add:

1. If you use the latest Flux version you should also be able to uninstall fluidpages and have the site operate in the exact same way with only Flux installed.

5. If anyone uses this query: don't forget that if you have multiple CTypes which use the same column name but with different colPos values then you also have to add an AND CType = 'my_ctype' clause to the query.

Happy to hear you solved it!

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

9 participants