-
Notifications
You must be signed in to change notification settings - Fork 448
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
[OJS 3.3] Cannot create Announcements: General error: 1364 Field 'setting_type' doesn't have a default value #6748
Comments
Hi,
|
@davidjb and @drugurkocak, are these upgraded OJS installations or fresh installs? |
@asmecher Thanks for looking into this! Mine is an upgrade, originally installed at 2.4.8, upgraded then to 3.2.1 and now to 3.3.0. Originally, the database was set up on a much older version of MySQL; because of this, I had database-encoding upgrading to 3.2.1 (fixed though and working fine for months), and then issues moving to 3.3.0 (detailed at https://forum.pkp.sfu.ca/t/serious-issue-with-database-upgrade-failed-from-3-2-1-3-to-3-3-0-2/65598/27) |
Dear @asmecher
Regards, |
I just noticed that I can't assign the new announcement to an announcement type since it is not listed on the dialouge. Also, when I click an existing announcement type, a blank (empty) dialogue is opened and a new one is created when I fill the title field. I can add and edit new announcement types, but can't edit or delete the previous types. I can't see any error on php-error.log while editing the announcement types. |
I have the same problem, and it is a clean install of OJS 3.3.0-3. [php7:notice] [pid 13752] [client 148.234.13.27:61705] Slim Application Error:\nType: Illuminate\Database\QueryException\nCode: HY000\nMessage: SQLSTATE[HY000]: General error: 1364 Field 'setting_type' doesn't have a default value |
The issue is caused by upgraded installations not having the
However, I would recommend also installing the patch attached to this issue (https://github.com/pkp/pkp-lib/commit/20b2f238e8ed3cd317d216f596edecac2b115a82.diff) -- it corrects some additional minor issues around announcement and announcement type creation. Your confirmation that this corrects the issue would be helpful! |
@asmecher For all the rows already in the table after the upgrade, their Edit: have updated the table in my installation and applied the patch -- all looks good for new entries and existing ones. Thank you! |
Hi @asmecher |
I think the |
Correct. |
Describe the bug
Creating an announcement on a journal with fails to create the announcement, erroring with:
However, a half-created announcement was created; screenshot below. I can delete this fine from the UI.
The insert SQL doesn't supply a
setting_type
, which is required by the database (setting_type varchar(6) NOT NULL
is in myannouncement_settings
table in the database). Looking at thelib/pkp/classes/migration/AnnouncementsMigration.inc.php
sets the field as nullable, but another field in the PKPv3_3 migration,submission_file_settings.setting_type
, gets a default type of'string'
set.To Reproduce
What application are you using?
OJS 3.3.0_3
Additional information
All existing rows in the table have
setting_type
as'string'
.Happy to provide a full traceback if required.
Here's how the announcement looks when the creation fails.
The text was updated successfully, but these errors were encountered: