Closed (fixed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Oct 2010 at 04:17 UTC
Updated:
25 Nov 2010 at 09:00 UTC
Jump to comment: Most recent file
When saving preset behaviors, always getting
# warning: asort() expects parameter 1 to be array, null given in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 615.
# warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 616.
# warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 616.
# warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 629.
# warning: asort() expects parameter 1 to be array, null given in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 615.
# warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 616.
# warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 616.
# warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/openlayers/modules/openlayers_ui/includes/openlayers_ui.presets.inc on line 629.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | init_layer_styles_weight2.patch | 1.25 KB | strk |
| #6 | 948058_dump.txt | 8.82 KB | ckng |
| #5 | init_layer_styles_weight.patch | 944 bytes | strk |
| #4 | openlayers-preset_layers_and_styles-948058-4.png | 80.54 KB | agileware |
| #3 | openlayers-preset_values_var_dump-948058-3.txt | 12.58 KB | agileware |
Comments
Comment #1
strk commentedCould you send a var_dump of $values when !isset($values['layer_weight']) in modules/openlayers_ui/includes/openlayers_ui.presets.inc ~ line 614 ?
I'm thinking a possible reason could be calls to openlayers_ui_presets_form_process with empty or no first arg.
Comment #2
dgastudio commentedsame problem.
Comment #3
agileware commentedChanging the title as it is just saving presets in general that causes this.
Re #1:
Attached is a var dump of $values when !isset($values['layer_weight'])
I also notice that on the "Layers & Styles" tab there is an overlay layers table below the base layers table that is empty aside from headers, one of which is for weight (screenshot attached).
Comment #4
agileware commentedThe problem goes away after I have created at least one OpenLayers Data view.
Then the overlay layers table is not empty (see screenshot) and you don't get the error.
Comment #5
strk commented@ckng : please try the attached patch (will need you to re-delete your OpenLayersData view to check).
Comment #6
ckngDo no see the different with the patch, getting same errors.
Attached is var_dump($values), the $values['layer_weight'] does not exist.
Comment #7
strk commentedWhat about this one ?
Comment #8
strk commentedI don't understand how you can have ["layer_styles"] and not have ["layer_weight"] when openlayers_ui_presets_form_process is invoked.
Comment #9
ckng#7 does not work as well.
["layer_styles"] present with #5, with #7 both also not present.
On openlayers_ui_presets_form_submit(), the values are set in $form, however the submit function only processes $form_state?
BTW, I'm not using OpenLayers Data view, ATM.
Comment #10
strk commentedI'm in the process of setting up an environment with no overlay layers to reproduce this.
Comment #11
strk commentedFixed by commit http://drupal.org/cvs?commit=449270
Comment #12
ckngConfirmed #11 works.