PHP 5.3 at least (the reported and tested against version) requires arguments to `call_user_func_array` to be passed by reference. There exists a note as a comment in the code, but was unfortunately overlooked in a previous commit to fix case sensitive sorting 4998b80445 (diff-6ba746c3d31fd6b4c4a99d7efe35eb21L442)
To solve this issue we simply first assign the constant to a variable, so we can then pass that by reference. This has no functional impact, however fixes an issue for users locked in to old PHP versions which we still list as supported (https://docs.silverstripe.org/en/3/getting_started/server_requirements/#web-server-software-requirements).
When using a view in a SilverStripe project, whenever the tear down scripts for the Unittests are run the following error occurs:
Couldn't run query:
TRUNCATE "ActivityPoints_view"
Table 'ss_tmpdb2391727.ActivityPoints_view' doesn't exist
This was due to the MySQLSchemaManager::tableList() function assuming that all records in the TABLES were actual tables containing data.
This small tweak fixes the issue by modifying the SQL to filter out views from the list before truncating.
These fixes allow *nix environments to connect to SQL Server using
the dblib PDO driver and the silverstripe mssql module.
- Only set MYSQL_ATTR_INIT_COMMAND when using the mysql driver, this
constant isn't defined if the mysql pdo driver isn't installed
- Supress warnings on getting the server version, attributes aren't
supported by the dblib driver
- Explicitly check for errors on sql exec, checking the return
value isn't reliable for statements with no return value (e.g.
USE database)
Change isset() to array_key_exists(). In the CMS, if you have a FormField such as 'My value', then you change it to '' (blank), isset() will return false because even though the key exists, the value === null by the time it reaches this point in the code, and isset() return false on null values. array_key_exists will return true with a null value