-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sbnm vols #32
Closed
Closed
Sbnm vols #32
+55
−24
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disable STRICT_TRANS_TABLES to allow the 0000-00-00 00:00:00 default timestamp used several places in this install file. I have not run into this as being an issue on recent CentOS setups, but it caused db install to throw an error on my personal dev machine with Server version: 5.7.24-0ubuntu0.18.04.1 (Ubuntu).
I am not sure that anything actually uses menu_problem. Cases older than 2008 use menu_problem_2007 and everything else uses menu_problem_2008. I don't think any org should be recording outcomes in cases opened before 2008.
PHP 7 does not allow a switch/case structure to have two defaults. This htmlContactList function is only called from a handful of places within Pika, and in none of these places is there a possibility for anything to be passed in besides 'intake', "case_contact', or nothing. And if it is called with no parameter, the function definition sets $mode to 'contacts'. So it does not appear to me that the default: case should even normally come into play. But if it somehow does, I think it makes more sense for it to be on the case: 'contacts' since this corresponds to the default value of the parameter in the function definition.
There is a behavior in the outcomes module where if outcomes are recorded, then the problem code is changed on the case, and additional outcomes are recorded, that a case can end up with outcomes from multiple problems recorded. This is undesirable and unexpected behavior for at least one organization I've been working with. This patch does not require that any database fields be added, but the following line will have to be added to the case-info.html subtemplate: <input id="prior_problem" name="prior_problem" type="hidden" value="%%[problem]%%">
Add a hidden field that will contain the value of the problem code at the time the page was loaded. Both prior_problem and problem get posted to update_case.php and if they are different, then the outcomes associated with the case will get cleared out.
…ient_id In certain situations where staff are merging contact cards while also working within the case info tab, it can be possible for an invalid primary client id to exist within the primary client dropdown on the case info tab. It then becomes possible to write this invalid value back to the database. The case then becomes completely inaccesible to staff. This patch checks to make sure that the contact ID number being written to cases.client_id actually exists within the contacts table. If it does not, then an empty string '' is written instead to the cases.client_id field.
When the extensions folder does not exist within cms-custom, (as is the case in the master repository), cms/systems-extensions.php will fail to load with a server error 503. I believe that what is happening is exactly what is described in this comment regarding this type of syntax creating an infinite loop if the filehandle is boolean false (as will be the case when the directory cannot be opened) rather than of a filehandle type: https://stackoverflow.com/questions/7630245/explaination-of-whilefalse-f-readdird/7630285#comment89057755_7630312 If I understand correctly, I think what is happening is that what the condition is actually doing is checking whether ($entry = readdir($h)) resulted in an assignment, which is not adequate because even when the directory does not exist, an assignment can still occur because readdir() returns boolean false on failure: https://www.geeksforgeeks.org/php-readdir-function/. $entry then is assigned the value false, and because an assignment occurred successfully, then the while loop is evaluating the condition `while (false !== true)` My suggestion to fix the issue so that this screen does not enter an infinite loop and throw server error 503 when cms-custom/extensions/ does not exist is to simply check to make sure that $h itself is not false as an additional condition in the while loop.
comment appears to have been carried over from ops/update_zipcode.php and is not an accurate description of the functionality of this file
ASC or DESC qualifiers for GROUP BY was removed from MySQL in version 8.0.13 in October 2018. From https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html: SQL Syntax Notes Incompatible Change: The deprecated ASC or DESC qualifiers for GROUP BY clauses have been removed. Queries that previously relied on GROUP BY sorting may produce results that differ from previous MySQL versions. To produce a given sort order, provide an ORDER BY clause. Queries and stored program definitions from MySQL 8.0.12 or lower that use ASC or DESC qualifiers for GROUP BY clauses should be amended. Otherwise, upgrading to MySQL 8.0.13 or higher may fail, as may replicating to MySQL 8.0.13 or higher slave servers.
The function getNotes is called from three places in the codebase: 1. modules/case-act.php, where it is called with all 5 arguments specified 2. ops/transfer_case.php where it is called with only two arguments, 3. reports/quick_docket/report.php where it is called with only one argument. This function as written provides default argument values for only 3 out of the 5 arguments. Prior to PHP version 7.1, passing too few arguments in situations like this would raise only a warning. Beginning with 7.1, it throws an error: https://www.php.net/manual/en/migration71.incompatible.php Adding default values for arguments 4 and 5 allows the function to be called with any number of arguments.
In some reports, clicking the "show sql" checkbox does not have any effect on the generated report because of a missing variable assignment
Methods with the same name as their class will not be constructors in a future version of PHP; plTable has a deprecated constructor in /opt/bitnami/apache2/htdocs/ocm/cms/app/extralib/lib/plTable.php on line 25. The new syntax was introduced in PHP5 but the old style did not become deprecated until PHP7. The syntax in this patch is a drop-in replacement. It should be compatible with both PHP 5 and PHP 7. https://www.php.net/manual/en/language.oop5.decon.php https://www.php.net/manual/en/migration70.deprecated.php https://stackoverflow.com/a/37100413
pulling in aworley's master changes from 2018 onward
Sbnm vols
replace PHP4 style constructor for class plTable
ASC or DESC qualifiers for GROUP BY removal
Handle calls to getNotes passing too few args
update comment
fix for when cms-custom/extensions/ does not exist
disable STRICT_TRANS_TABLES
Sbnm vols
Sorry, accidentally submitted merge request went to wrong repo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.