Skip to content
This repository

Allow multiple parameters and clean up the way we go about handling defa... #15

Merged
merged 1 commit into from over 1 year ago

1 participant

brandonsavage
brandonsavage
Collaborator

...ult fields.

brandonsavage
Collaborator

r+ from Lawrence Mandel

brandonsavage brandonsavage merged commit fa11bbe into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 19, 2012
brandonsavage brandonsavage Allow multiple parameters and clean up the way we go about handling d…
…efault fields.
e4865dd
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 18 additions and 2 deletions. Show diff stats Hide diff stats

  1. +18 2 BugzillaQuery.class.php
20 BugzillaQuery.class.php
@@ -191,7 +191,11 @@ function __construct($type, $options, $title='') {
191 191 public function _fetch_by_options() {
192 192
193 193 // Set up our HTTP request
194   - $request = new HTTP_Request2($this->url,
  194 + $options_array = array();
  195 +
  196 + $options_array = array(Net_Url2::OPTION_USE_BRACKETS => false);
  197 + $net_url2 = new Net_Url2($this->url, $options_array);
  198 + $request = new HTTP_Request2($net_url2,
195 199 HTTP_Request2::METHOD_GET,
196 200 array('follow_redirects' => TRUE,
197 201 // TODO: Not sure if I should do this
@@ -203,13 +207,25 @@ public function _fetch_by_options() {
203 207
204 208 // Save the real options
205 209 $saved_options = $this->options;
206   -
  210 +
  211 + if(!isset($this->options['include_fields'])) {
  212 + $this->options['include_fields'] = array();
  213 + }
  214 +
  215 + if(!is_array($this->options['include_fields'])) {
  216 + (array)$this->options['include_fields'];
  217 + }
  218 +
207 219 // Add any synthetic fields to the options
208 220 if( !empty($this->synthetic_fields) ) {
209 221 $this->options['include_fields'] =
210 222 @array_merge((array)$this->options['include_fields'],
211 223 $this->synthetic_fields);
212 224 }
  225 +
  226 + if(!empty($this->options['include_fields'])) {
  227 + $this->options['include_fields'] = implode(",", $this->options['include_fields']);
  228 + }
213 229
214 230 // Add the requested query options to the request
215 231 $url = $request->getUrl();

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.