Uploading error of image

Started by Sudhakar Arjunan, June 06, 2023, 05:55:50 PM

Previous topic - Next topic

Sudhakar Arjunan

Tried uploading an attached and it showed some error. Then home admin homepage shows this

 https://forum.com/index.php?
 /home/forum/public_html/Sources/Subs-Attachments.php (Line 1402)   Backtrace information

Type of error: Critical
Error messageSelect
Wrong value type sent to the database. Array of integers expected. (preview_attachments)
Function: prepareAttachsByMsg
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Kindred

what mods do you have installed?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sudhakar Arjunan

1   Google Analytics Code   1.6.1   02 April 2023, 06:52:12
5   SMF Gallery Lite   7.1a   02 April 2023, 16:12:12 - after installation it tried importing items from aeva media gallery to smf gallery lite but failed ( here is the link for the topic )
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Kindred

i'd suggest uninstalling gallery and see if that fixes things
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sudhakar Arjunan

#4
Quote from: Kindred on June 08, 2023, 02:23:10 PMi'd suggest uninstalling gallery and see if that fixes things
Just got update from author - link
not related to the gallery we do not touch file  attachments with SMF Gallery

Still issue persist while trying to upload any attachment to post. Any help



Error message in log,
Database Error: Field 'id_issue' doesn't have a default value


 INSERT INTO smf_attachments(`id_folder`, `id_msg`, `filename`, `file_hash`, `fileext`, `size`, `width`, `height`, `mime_type`, `approved`)
 VALUES
 (1, 0, SUBSTRING('apple-beta-software-agreement-ea1846.pdf', 1, 255), SUBSTRING('a1439c599dfb2f45febd7b599ee42a503e41731e', 1, 40), SUBSTRING('pdf', 1, 8), 829962, 0, 0, SUBSTRING('application/pdf', 1, 20), 1)
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Doug Heffernan

Quote from: Sudhakar Arjunan on July 06, 2023, 02:06:42 PMDatabase Error: Field 'id_issue' doesn't have a default value

Give the aforementioned field a default value of null. That ought to fix it.

Sudhakar Arjunan

Quote from: Doug Heffernan on July 06, 2023, 02:26:07 PM
Quote from: Sudhakar Arjunan on July 06, 2023, 02:06:42 PMDatabase Error: Field 'id_issue' doesn't have a default value

Give the aforementioned field a default value of null. That ought to fix it.

You mean as in here, once you helped me - in this link

You are asking me to try
ALTER TABLE smf_attachments SET id_issue NULL

Is it ? do advise.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum


Sudhakar Arjunan

Hi Doug Heffernan,

Structure - 15   id_issue  Index   int(10)      UNSIGNED   No   None
Indexes -    id_issue   BTREE   No   No   id_issue   1   A   No   

Tried this command in sql
ALTER TABLE smf_attachments SET id_issue NULL

Returned this error

Error
Static analysis:

2 errors were found during analysis.

A new statement was found, but no delimiter between it and the previous one. (near "SET" at position 28)
Unrecognized alter operation. (near " " at position 40)
SQL query: Copy

ALTER TABLE smf_attachments SET id_issue NULL;

MySQL said: Documentation

#1064 - 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 'SET id_issue NULL' at line 1
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Doug Heffernan

The syntax of the query is not correct by the looks of it.

Try the following, go to the smf_attachments table, click the Structure button at the top, select said column and click the edit button. Next step is to untick the NOT NULL option and save the changes.

Kindred

Your SQL is setting the VALUE for the column....    which you can not do, because that would result in your erasing all of the current values.

you need to set the DEFAULT!

from w3, the format is...
ALTER City SET DEFAULT 'Sandnes';
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sudhakar Arjunan

Noted will try tomorrow and update, thanks kindred also Doug heffernan.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

shawnb61

#12
Pretty sure you need to specify both tablename & colname, something like:
ALTER TABLE tablename ALTER colname SET DEFAULT NULL;

If NULL is not allowed on that column, you may need to provide a different default.

EDIT: Slight tweak to sql above...
A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: