-
Notifications
You must be signed in to change notification settings - Fork 65
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
Issue 145 [Follow-up]: Use singleton for database connection #343
Issue 145 [Follow-up]: Use singleton for database connection #343
Conversation
Extend singleton to all modules
@fondrenlibrary would you review this PR? If it can be merged, then we can close #145 and #245 |
Do you have the same error when switching to the development branch? |
Same error when switching to the development . No error spotted in the error log. |
@fondrenlibrary I have experienced this when testing other PRs that change the
Make sure the version isn't set to 2.1.0; that's when I've seen this problem. |
[Wed Jan 31 09:45:31.173891 2018] [:error] [pid 35085] [client 10.74.22.178:54606] PHP Fatal error: Uncaught exception 'Exception' with message 'There was a problem with the database: Unknown column 'R.acquisitionTypeID' in 'on clause'' in /var/www/html/CoralMaster/resources/admin/classes/common/DBService.php:52\nStack trace:\n#0 /var/www/html/CoralMaster/resources/admin/classes/common/DBService.php(91): DBService->checkForError()\n#1 /var/www/html/CoralMaster/resources/admin/classes/domain/Resource.php(1228): DBService->processQuery('SELECT R.resour...', 'assoc')\n#2 /var/www/html/CoralMaster/resources/ajax_htmldata/getSearchResources.php(35): Resource->search(Array, 'R.createDate DE...', '0, 25')\n#3 /var/www/html/CoralMaster/resources/ajax_htmldata.php(24): include('/var/www/html/C...')\n#4 {main}\n thrown in /var/www/html/CoralMaster/resources/admin/classes/common/DBService.php on line 52, referer: http://10.74.22.184/CoralMaster/resources/index.php |
Sounds like your database and codebase are out of sync.
This PR is based on master, and your database seems to be on development. |
Why this PR is based on the master branch instead of the development one? The standard way is not like this I think. |
Another question could be: why would you switch branch instead of merging to the target branch? :) That being said, seeing the previous commits on my branch, I was wrong to say that this PR is based on master, it's not, it's based on devel. The other reason to merge on the target branch instead of switching branch would be that you want to make sure that the development you're testing is correct towards the current state of the target branch, not the state of the branch at the time it started. Does that make sense to you? |
If it helps anyone, I sometimes use a workflow that involves patching instead of all the merging in order to test PRs. I checkout the current development branch, and then I apply a patch for the pull request. A quick one-liner would be: This way it is always easy to undo changes for a single pull request. @veggiematts Do you have a recommended testing procedure? Which pages or forms would be ideal to check against this PR to look for problems? |
After rebase the local biblibre-Issue_145_Followup_DB_Connections branch to the local development branch, the test can be done and I don't see any particular problems introduced by this PR. Thank @veggiematts and @t4k . |
Don't know if this helps but that error message can be found in In short, I believe that error means that
The rationale for this is that when this is changed it means that whoever the maintainer is updating this file is confident that the upgrade path works from |
Thanks @fondrenlibrary |
Great! I'm confident in the testing from you two. |
I'll be merging this tomorrow unless there are objections from anyone before then. |
As pointed out in #245 , the patch recently merged in development as part of #292 only addressed the problem for the resource module.
This PR extends the use of a single DB connection to all modules.