Closed (fixed)
Project:
Jira REST
Version:
7.x-6.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Jun 2015 at 07:19 UTC
Updated:
28 Jul 2015 at 08:14 UTC
Jump to comment: Most recent
After upgrading, if you try to create an issue using existing code, you get the following error:
Fatal error: Unsupported operand types in .../sites/all/modules/jira_rest/jira_rest.module on line 74
The problem is that the API changed. The compatibility wrapper file is clearly intended to adapt calls made using the old API to the new, but it doesn't work.
Here's lines 70 - 72 of jira_rest_compatibility_wrapper.inc :
function jira_rest_createissue($issue_data, $options = array()) {
return jira_rest_issue_create($issue_data, $options);
}
I changed those lines to the following and it worked:
function jira_rest_createissue($username, $password, $issue_data) {
$options = array(
'username' => $username,
'password' => $password,
);
return jira_rest_issue_create($issue_data, $options);
}
In order to make the compatibility wrapper work, a similar change would need to be made for every function in the file. ...Or you could just trash the file and document that the old API is deprecated.
Comments
Comment #1
klabowterman commentedhi, could you please paste in the code where/how you call the (deprecated) function to jira_rest?
i tested it myself calling the old jira_rest_createissue() function and the new jira_rest_issue_create() and had no problems, this is the code:
Comment #2
jlnd commentedHi @klabowterman,
In 7.x-5.1 line 218 of the jira_rest.module file looked like this:
function jira_rest_createissue($username, $password, $issuedata) {So my code looked like this...
$response = jira_rest_createissue($username, $password, $issuedata);...and...
Comment #3
klabowterman commentedHi @jlnd,
i see, i'll hand this over to @tseifert as he is in charge for the jira_rest_compatibility_wrapper.inc.
thanx for sharing this bug!
Comment #4
tseifert commentedHi @jlnd,
you're right, the compatibility wrapper is still missing a lot of functions from the 7.x-5.1 branch.
In general we advise to use the new API of this module - however I will add the missing functions from that branch.
This should be available next week.
Comment #6
tseifert commentedThis issue should be fixed with the new 7.x-6.2 release.