Database error

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1172
    NJS2020
    Participant

    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.

    #1173
    RRowley
    Participant

    The 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.

    #1178
    NJS2020
    Participant

    Hi 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.

    #1179
    RRowley
    Participant

    This 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.