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

Incorrect integer value error when importing empty value for integer columns #39

Open
hissy opened this issue Mar 29, 2024 · 1 comment

Comments

@hissy
Copy link
Contributor

hissy commented Mar 29, 2024

Handling "PortlandLabs\Concrete5\MigrationTool\Publisher\Command\PublishPageContentCommand" failed: An exception occurred while executing 'INSERT INTO btImageSliderEntries (bID, id, cID, fID, linkURL, internalLinkCID, title, description, sortOrder) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [187, "4262", "0", "", "", "0", "\u30bf\u30a4\u30c8\u30eb\u3068", "
\u672c\u6587\u306e\u307f<\/p>\n", "0"]: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'fID' at row 1

You can reproduce this issue by adding an image slider block with entries with no images selected.

@hissy
Copy link
Contributor Author

hissy commented Mar 30, 2024

I gave up trying to fix this issue on Version 9 because I couldn't decide how to fix it.

This issue is quite similar to concretecms/addon_migration_tool#104 and can be reproduced using the same XML file, but the same change for StandardPublisher doesn't solve this issue on Concrete version 9.

I think the best way is to check the column definition before saving data to the database in the \Concrete\Core\Legacy\BlockRecord class. However, the class is already deprecated, so we may have to create a new modern BlockRecord class to handle additional tables.

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

1 participant