Closed (fixed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
OpenLayers UI
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2010 at 11:19 UTC
Updated:
18 May 2010 at 19:33 UTC
When saving a preset in the UI, we have observed the attached text being printed to the screen, there is no other output, just this. I'm assuming it's the result of an AHAH operation but a simple grep for unintentionally included 'echo' or 'print' debug statements doesn't find anything. Unfortunately I haven't had time to do any further digging.
We've tested in Firefox 3.5.9 and are not doing anything particularly unusual, just adding a layer, then saving a preset.
| Comment | File | Size | Author |
|---|---|---|---|
| openlayers_output.txt | 5.82 KB | johngriffin |
Comments
Comment #1
tmcw commentedBizarre. I think I've seen this once or twice. Can you try running with Firebug or an equivalent open to see if there are any Javascript errors popping up?
Comment #2
buddhamagnet commentedI am having this issue also. Chrome console shows:
Resource interpreted as document but transferred with MIME type text/javascript.
I am dynamically rebuilding a select box using AHAH but this is only done on change. When the form submits (which does not call that function) I get the JSON splat.
Comment #3
buddhamagnet commentedThe form elements are:
$form['select_platform'] = array(
'#type' => 'select',
'#title' => t('Select platform'),
'#options' => array('N/A' => 'N/A', 'PSP' => 'PSP', 'ps2' => 'Playstation 2', 'ps3' => 'Playstation 3', 'ds' => 'NintendoDS', 'gamecube'=> 'Gamecube', 'wii' => 'Wii', 'xbox' => 'Xbox', '360' => 'Xbox360', 'mac' => 'Mac', 'advance' => 'Gameboy Advance', 'pc' => 'PC'),
'#ahah' => array(
'event' => 'change',
'path' => 'ajax/get_prizes_ahah',
'wrapper' => 'ahah-wrapper',
'method' => 'replace',
),
);
$form['prizes2'] = array(
'#type' => 'select',
'#title' => t('Select from a choice of games'),
'#options' => sr_incentives_get_prizes('game'),
'#prefix' => '
'#suffix' => '
',
);
...and the AHAH method is:
function sr_incentives_ajax_get_prizes_ahah() {
$form_state = array('storage' => NULL, 'submitted' => FALSE);
$form_build_id = $_POST['form_build_id'];
$platform = $_POST['select_platform'];
watchdog('sr_incentives', "PLATFORMAGE: $platform", array(), WATCHDOG_DEBUG);
$form = form_get_cache($form_build_id, $form_state);
$args = $form['#parameters'];
$form_id = array_shift($args);
$form_state['post'] = $form['#post'] = $_POST;
$form['#programmed'] = $form['#redirect'] = FALSE;
$query_prizes = db_query("SELECT disp, name FROM {sr_incentives_prizes} WHERE category = 'game' AND count > 0 AND platform = '%s' ORDER BY disp ASC", array($platform));
$prizes = array();
while ($row = db_fetch_array($query_prizes)) {
$prizes[$row['name']] = $row[disp];
}
$ahah_form = $form['prizes2'];
$ahah_form['#options'] = $prizes;
form_set_cache($form_build_id, $form, $form_state);
drupal_process_form($form_id, $form, $form_state);
$form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
unset($ahah_form['#prefix'], $ahah_form['#suffix']);
$output = drupal_render($ahah_form);
drupal_to_js(array('status' => TRUE, 'data' => $output));
}
Comment #4
tmcw commentedbuddhamagnet: can you test taking out the custom code and seeing whether the issue persists?
Comment #5
tmcw commentedAny luck trying this without the custom code? If the form is not getting rebound by jQuery after something is done to it, this will be the result.
Comment #6
tmcw commentedClosing, please reopen if the issue is persisting or you can give more information.