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

Error: You have an error in your SQL syntax; #305

Open
linawolf opened this issue Nov 24, 2024 · 7 comments
Open

Error: You have an error in your SQL syntax; #305

linawolf opened this issue Nov 24, 2024 · 7 comments
Labels

Comments

@linawolf
Copy link
Contributor

Describe the bug
On doing database compare after creating my block I get the following error:

image

To Reproduce

name: t3docs/carousel
typeName: t3docs_carousel
group: default
prefixFields: true
prefixType: full
fields:
  - identifier: carousel-items
    type: Collection
    foreign_field: parentid
    fields:
      - identifier: header
        type: Text
      - identifier: description
        type: Textarea
        enableRichtext: true
      - identifier: image
        type: File

Expected behavior
If the special sign - is not possible it should be forbidden or transformed.

TYPO3 Version
13.4.1

Content Blocks Version:
friendsoftypo3/content-blocks (1.0.4)

Additional context
Using identifier: carousel_items works

@nhovratov
Copy link
Contributor

Related: #30

@nhovratov
Copy link
Contributor

@linawolf This works for me. I have ddev with MariaDB 10.3.

It's not forbidden to have dashes. MySql supports it. But in some cases they are not escaped. This is probably an issue in Core. Not sure if this is related to certain DBs / version.

@linawolf
Copy link
Contributor Author

Using
mariadb_version: "10.5", php_version: "8.2"
In ddev this causes an error for me

@nhovratov
Copy link
Contributor

nhovratov commented Nov 24, 2024

See, for me it is escaped:
Screenshot 2024-11-24 at 20-13-47 Install Tool on site New TYPO3 Project · New TYPO3 Project TYPO3 CMS 13 4 1

I'll check 10.5

@nhovratov
Copy link
Contributor

I don't know, this would be an arbitrary decision. Better fix Core to properly escape them. We should just only document underscore and state this is best practice.

Just checked with Maria 10.5, works for me.

@linawolf
Copy link
Contributor Author

Would it be hard to sanitize the input? There could be other special signs causing trouble or worse as well?

@nhovratov
Copy link
Contributor

Needs to be discussed with some Core developers. I have no idea what characters are allowed / not allowed cross-db. I don't see it being the responsibility of this extension right now. In the end, this is just converted to TCA. And if you define a TCA column with dashes, this would be exactly the same.

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

2 participants