Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2729

PDO type casting error in bind parameters

    XMLWordPrintable

Details

    • Critical
    • The user will no longer receive an error when the customer was deleted.

    Description

      Example of the query which produces the problem in php8 and it was working with php 7.4:

      $sql = "UPDATE `LEK_languageresources_usage_log` SET `customers` = replace(customers, ',?,', ',')"; 
      $this->db->getAdapter()->query($sql,$customerId); 
      

      $customerId is integer function argument.

      It seams like that the binding argument is evaluated differently(in our case as string) or not even replaced in the placeholder by php8. This problem possibly can happen because of change in php8 pdo where PDO::PARAM_INT is treated the same as PDO::PARAM_STR in one of the PDO classes. More pdo changes related to this problem can be found in the php8 changelog page: https://www.php.net/ChangeLog-8.php

       

      This problem does not effect any other translate5 code so far.

      Attachments

        Activity

          People

            aleksandar Aleksandar Mitrev
            aleksandar Aleksandar Mitrev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: