Bug #52661
SQL error when saving DCE
100%
Description
When I'm saving DCE I'm getting SQL error..if I click edit for new created DCE and save it again everything is fine again.
2: SQL error: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=0, header='\r\ntest\r\n', bodytext='\n<ul>\n \n \n \n \n \n ' at line 44' (tt_content:423)
Server has this configuration:
- PHP Version 5.4.12
- MySQL Support - Client API version: 5.1.66
Files
Updated by Nicole Schmitt over 7 years ago
I have the same error.
Trying to get new images in a section with FAL doesn't work with this error. FE Error: Incorrect reference to original file given for FileReference.
all other contents are fine.
Updated by Davor Jambor over 7 years ago
Nicole Schmitt wrote:
I have the same error.
Trying to get new images in a section with FAL doesn't work with this error. FE Error: Incorrect reference to original file given for FileReference.
all other contents are fine.
I don't know if this will help you but here is the way I'm getting images in frontend..
<f:for each="{shop}" as="tweet"> <f:if condition="{tweet -> dce:isArray()}"> <f:then> <f:for each="{tweet}" as="bee"> <f:cObject typoscriptObjectPath="lib.dce.image" data="{bee}" /> </f:for> </f:then> <f:else> </f:else> </f:if> </f:for> lib.dce.image = COA lib.dce.image{ 30 = FILES 30.references{ table = tt_content uid.field = uid fieldName = thisVariableName } 30.renderObj = COA 30.renderObj { 10 = IMAGE 10{ file{ import.data = file:current:publicUrl maxW = 200 maxH = 100 } } } }
I'm still not really good with fluid so I'm doing some combination between classic typoscript and fluid..
I have images in section element so there is more code then necessary but pay attention to that:
<f:cObject typoscriptObjectPath="lib.dce.image" data="{bee}" />
Updated by Nicole Schmitt over 7 years ago
Thanks. I think the problem is that we use "File Abstraction Layer" to add more images at once. and we need an extra field not only title and description. so we put this code to the helper:
<foreign_types type="array"> <numIndex index="2"> <showitem>title,description,alternative</showitem> </numIndex> </foreign_types>
on another web without the extra field it works.
Updated by Armin Vieweg over 7 years ago
- File 2013-10-10_1742.png 2013-10-10_1742.png added
- File 2013-10-10_1743.png 2013-10-10_1743.png added
- Status changed from New to Needs Feedback
Hmmmm... using FAL in sections works for me properly. In Backend and Frontend. No SQL or other errors.
I've tested it with 6.1.1 and latest DCE version.
Backend:
Frontend:
Updated by Armin Vieweg over 7 years ago
Btw. I hope you are not using inline fields for FAL inside of sections. I can't imagine that this will work! Especially not in flexforms.
Updated by Nicole Schmitt over 7 years ago
no fal inside of sections.
this works for me now:
<foreign_types type="array"> <numIndex index="2"> <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem> </numIndex> </foreign_types>
But the SQL Error still appears.
Updated by Davor Jambor over 7 years ago
- File 01_dce_preview.jpg 01_dce_preview.jpg added
- File 02_add_content_element.jpg 02_add_content_element.jpg added
- File 03_sql_error.jpg 03_sql_error.jpg added
- File 04_works_after_edit.jpg 04_works_after_edit.jpg added
OK..I did a bit of testing and I'm sure that SQL error appear because of inline fields..I created new DCE, first with simple input text and it's all good, but after adding inline FAL element SQLerror appear. And I didn't use it in section.
Updated by Armin Vieweg over 7 years ago
Screenshots are nice, but could you attach your DCE as t3d-Export please? This would make it much easier for me.
Thanks :)
Updated by Davor Jambor over 7 years ago
- File T3D__2013-10-11_09-50-z.t3d added
You have a good point.. :)
I have attached t3d file..
BTW..you are doing great job with extension..it's exactly what typo3 is missing
Updated by Armin Vieweg over 7 years ago
Thanks Davor,
but your export includes all tables from your root level, including backend users, dev log entries, etc.
Could you please attach the export again, with just tx_dce_* tables selected?
Thank you very much.
Updated by Davor Jambor over 7 years ago
Hi..sorry for a bit later reply, I was quite busy.
In attachment you can find new t3d export..tnx
Updated by Hermann Scharitzer about 7 years ago
First of all: Kudos for this amazing extension!
Secondly, I unfortunately have the exact same issue.
Do you need more information/templates/dbdumps to help you resolve this?
Updated by Armin Vieweg about 7 years ago
- File 2013-10-17_1502.png 2013-10-17_1502.png added
- Status changed from Needs Feedback to Accepted
- Assignee set to Armin Vieweg
Thanks to Davor's t3d-export I am able to reconstruct this bug:
I'll try to figure out why this bug happens. Somehow the sql query contains a =1
without any fieldname. This =1
seems to be the amount of images, which have been added. Maybe this is a TYPO3 bug. I will keep you up to date with my progress.
Updated by Nicole Schmitt about 7 years ago
Hello!
Do you have any news on this?
We need a solution for this. Can we help you to find out more?
Updated by Julian Hofmann about 7 years ago
\TYPO3\CMS\Core\DataHandling\DataHandler::processRemapStack() does a remapping of relations. There is special remapping for flexform fields, so normally these fields are updated in a special way.
Around line 4868, once again the processDatamap_afterDatabaseOperations hook is called. This hook is used by DCE, but the registered method \tx_saveDce::processDatamap_afterDatabaseOperations() does not care about the type of field. It is called for flexform values, too.
Updated by Julian Hofmann about 7 years ago
A simple filter at the beginning of DCE's hook function (\tx_saveDce::processDatamap_afterDatabaseOperations()) should solve the problem:
old:
$this->fieldArray = $fieldArray;
new:
$this->fieldArray = array(); foreach ($fieldArray as $k => $v) { if (!empty($k)) { $this->fieldArray[$k] = $v; } }
Updated by Davor Jambor about 7 years ago
This patch is really working. Thank you Julain and Armin.
Updated by Manuel Thaler almost 7 years ago
Davor Jambor wrote:
This patch is really working. Thank you Julain and Armin.
Yes, patch is working.
Sadly Images are not copied.
Actually there is another issue opened for the copy bug (http://forge.typo3.org/issues/37667).
Any idea when the next update comes out in TER?
Because of the many bugs in flux, this really looks like a great alternative.
Updated by Davor Jambor almost 7 years ago
Hi Armin.
Can you please add fix from Julian to your next DCE update? Right now I have to make this update manually.
ext\dce\Classes\Hooks\tx_saveDce.php $this->fieldArray = array(); foreach ($fieldArray as $k => $v) { if (!empty($k)) { $this->fieldArray[$k] = $v; } }
I'm also interested when do you plan to release DCE with TCA support?
I saw your presentation with this update once typo 6.2 will be released, but since they postpone their release I'm curious if you will release DCE at the same time like they will?
BTW..another feature I would find useful is field where all content elements configuration will be combined together, one after another..this would be good for copying DCE element on fast way without some mayor rewriting from your side (I guess)
Thank you so much for this extension..it's extremely useful..hope typo3 core team will recognize it too
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch master of project TYPO3CMS/Extensions/dce has been pushed to the review server.
It is available at https://review.typo3.org/31093
Updated by Armin Vieweg over 6 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Released in version 0.10.1