Closed (fixed)
Project:
Xero API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Nov 2010 at 19:39 UTC
Updated:
2 May 2012 at 03:30 UTC
Jump to comment: Most recent file
If you specify a nonexistent/unreadable Xero cert or key file in xero.module's admin interface, the user gets a WSOD when attempting to post hours (because the instantiation of the Xero class returns false, but xero.module doesn't detect it).
The attached patch validates that the cert and key files are readable.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 959240-combined-fork-admin-3.patch | 5.54 KB | Shiny |
| #6 | 959240-combined-fork-admin-2.patch | 5.16 KB | mradcliffe |
| #5 | 959240-combined-fork-admin.patch | 3.6 KB | mradcliffe |
| #3 | xero-object-validation-959240.patch | 5.13 KB | mradcliffe |
| #3 | php-xero.patch | 429 bytes | mradcliffe |
Comments
Comment #1
mradcliffeHmm... xero_query should return NULL if it cannot create a proper $xero object. My error checking in xero_query is bad. $xero is always going to be an object, but I should really be checking the oauth variables.
The private variables consumer, token, and signature_method should be objects and the private format variable should be a string. If it cannot create a valid oauth connection those will be NULL.
This also affects the simpletest connection test.
I do think element validate would be good, but it won't fix the entire issue.
Comment #2
mradcliffeCurrently I can't properly check if the $xero object is valid because its member variables are private. I've written a patch for PHP-Xero, which this will depend on.
Comment #3
mradcliffeForgot to attach some patches... Won't work until php-xero is patched.
Comment #4
mradcliffeClosed #1108706: validate files on admin form submit as a duplicate.
Comment #5
mradcliffeCombining patches from local commits I just made:
Comment #6
mradcliffeAnother one to adjust install/status requirements.
Comment #7
Shiny commentedCombined patch results in:
Parse error: syntax error, unexpected ';' in /home/brenda/workspace/drupal/modules/xero/xero.install on line 47
Comment #8
Shiny commentedre-rolled with that parse error in .install gone
Comment #9
Shiny commentedThe php-xero.patch includes this line:
+ if ( !is_object($this->consumer) || !is_object($this->token) || !is_object($thi
the end of the line is missing.
Comment #10
mradcliffeUgh, sorry for the delay.
http://drupalcode.org/project/xero.git/commit/4d54ab2
Comment #11
mradcliffeOkay, fixed and tested. That was a quick version :(