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

Uncaught exception when trying to save record. #2722

Closed
burtyb opened this issue Nov 26, 2023 · 1 comment
Closed

Uncaught exception when trying to save record. #2722

burtyb opened this issue Nov 26, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@burtyb
Copy link
Sponsor

burtyb commented Nov 26, 2023

Describe the bug
When trying to save an FAQ record I see the following error.

phpMyFAQ Fatal error
Uncaught exception: 'mysqli_sql_exception'

Message: 'Data truncated for column 'comment' at row 1'

Stack trace:

#0 .../public_html/src/phpMyFAQ/Database/Mysqli.php(308): mysqli->query()
#1 .../public_html/src/phpMyFAQ/Faq.php(1006): phpMyFAQ\Database\Mysqli->query()
#2 .../public_html/admin/record.save.php(153): phpMyFAQ\Faq->update()
#3 .../public_html/admin/index.php(358): require('...')
#4 {main}
Thrown in '.../public_html/src/phpMyFAQ/Database/Mysqli.php' on line 308

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade MariaDB on existing install to MariaDB >=10.2.4.
  2. Login as Admin.
  3. Try to edit an FAQ
  4. See error

Expected behavior
Updated record to save successfully.

phpMyFAQ (please complete the following information):

  • phpMyFAQ version 3.2.2
  • PHP version 8.2.11
  • Database MariaDB 10.6.15
  • Elasticsearch no

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 119.0.6045.160 (Official Build) (64-bit)

Additional context

The SQL to update the faqdata has "... comment='' ..." which causes the error, changing it to "... comment='n' ..." the query succeeds and updates the FAQ entry.

Removing STRICT_TRANS_TABLES from MariaDB "sql_mode" also resolves the issue but it's enabled by default as of MariaDB 10.2.4.

@thorsten thorsten self-assigned this Nov 26, 2023
@thorsten thorsten added the Bug label Nov 26, 2023
@thorsten thorsten added this to the 3.2.4 milestone Nov 26, 2023
@thorsten
Copy link
Owner

Thanks for the hint, it's fixed for 3.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants