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

Versions broken when using Doctrine Schema Representation to define DCA's sql #1219

Closed
fiedsch opened this issue Jan 20, 2020 · 1 comment
Closed
Labels
Milestone

Comments

@fiedsch
Copy link
Contributor

fiedsch commented Jan 20, 2020

Affected version(s)

Contao 4.8.7

Description

When comparing old and new version of a record while debug mode is switched on I get:

Warning: strncmp() expects parameter 1 to be string, array given
Exception Logs 1 Stack Trace
ErrorException
in vendor/contao/core-bundle/src/Resources/contao/classes/Versions.php (line 508)

It however works when debug mode is switched off.

How to reproduce

Define a DCA field using Doctrine Schema Representation as described in the documentation, e.g.:

             'sql'       => ['type' => 'string', 'length' => 255, 'default' => ''],

instead of

             'sql'       => "VARCHAR(255) NOT NULL default ''",

create a new version of such a record and click the compare icon with debug mode switched on.

Cause is probably the DCAExtractor which uses

$this->arrFields[$field] = $config['sql'];

and thus creating an array entry as opposed to the expected string entry.

@aschempp
Copy link
Member

siehe #1251

leofeyer pushed a commit that referenced this issue Feb 11, 2020
Description
-----------

fixes #1219

Commits
-------

a2333e0 Handle array SQL definitions in version comparison
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants