Problem/Motivation
Steps to reproduce
1. Installed module using composer with command: composer require 'drupal/academic_marksheet:^1.0'
2. Enable the module /admin/modules
3. Go to path /student/details
4.Add student details
5. Click on Add student
You will get errors:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'course' at row 1: INSERT INTO "student_details" ("student_name", "roll_no", "dob", "address", "course", "sem_id", "academic_year") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => Rahul [:db_insert_placeholder_1] => 14 [:db_insert_placeholder_2] => 1990-10-10 [:db_insert_placeholder_3] => Dehrakhas Dehradun 248001 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => ) in Drupal\academic_marksheet\Form\StudentDetailsForm->submitForm() (line 199
Proposed resolution
Cast the course id, sem id, and academic year value using (int).