SimpleInvoices Group Forum › Forums › Fearless359 SimpleInvoices Discussion Group › Database error
Tagged: Database SystemDefaults.php
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by RRowley.
-
AuthorPosts
-
November 3, 2020 at 11:46 am #1172NJS2020Participant
Just updated to 2000 via 20019.2 as advised and I am getting:
Fatal error: Uncaught TypeError: Return value of Inc\Claz\SystemDefaults::getDelete() must be of the type int, string returned in /var/www/vhosts/si.coastl.co.uk/httpdocs/simpleinvoices/Inc/Claz/SystemDefaults.php:216 Stack trace: #0 /var/www/vhosts/si.coastl.co.uk/httpdocs/simpleinvoices/modules/system_defaults/manage.php(28): Inc\Claz\SystemDefaults::getDelete() #1 /var/www/vhosts/si.coastl.co.uk/httpdocs/simpleinvoices/index.php(441): include(‘/var/www/vhosts…’) #2 {main} thrown in /var/www/vhosts/si.coastl.co.uk/httpdocs/simpleinvoices/Inc/Claz/SystemDefaults.php on line 216.Opening the database and looking at the system-default table, delete record this set as a char record rather than the int it should – as expected by SystemDefaults.php. Has this been corrected somewhere that I have missed? Thanks.
November 3, 2020 at 2:09 pm #1173RRowleyParticipantThe si_system_defaults record with the NAME of “delete” should have a value of 1 or 0. I recommend you manually set it to 0 (aka false) before running the update. Then you can set it via SI after the update if you want to enable the ability to delete invoices from the database.
November 4, 2020 at 10:15 am #1178NJS2020ParticipantHi Richard. The problem is not the content of the record but it’s type which should be int() not char() which it is. I have changed the default which was ‘N’ to ‘0’ but that makes no difference to the error returned. I’m not sufficiently familiar with databases to know how to change a record type. Otherwise great work on a useful program I’ve used for many years.
November 4, 2020 at 1:38 pm #1179RRowleyParticipantThis is a multi-use table. The value field in the database is varchar(60). The PHP function that retrieves the data returns a type int value. 0 or 1 meet this qualification. Or at least that is for my development and my production systems. My development system is Win 10 using xampp. My production is a hosted LAMP web service. Both are at the 7.4x PHP version.
There is no strict_type declaration in SI, therefore as long as the value being returned begins with a number (at least as I understand it), the number will be converted per the type declaration. So if the value in the database is 0 or 1, or even “0 ” or “1 “, it should be converted to the correct int and no type error thrown.
Bottom line, I am not sure why you are having an issue.
-
AuthorPosts
- You must be logged in to reply to this topic.
Recent Comments