alkacon / opencms-core

The Java open source content management system by Alkacon Software
http://www.opencms.org
GNU Lesser General Public License v2.1
528 stars 575 forks source link

Misleading google maps api key error when using LocationPicker-Widget #491

Closed Belarophon closed 7 years ago

Belarophon commented 7 years ago

We have problems using the LocationPicker-Widget in openCMS 10.5.1. Whenever we specify a new location, it is empty. So no preview is shown. When trying to edit it (folder-symbol) it shows the error message 'Missing Google Maps API Key...'. The problem is that we provided a valid key via the root folder properties. Debugging the method CmsLocationPickerWidget.getConfiguration() also confirmed that our provided key is used. The problems seems to be the missing map preview, since this is also one of the things that is checked in method CmsLocationController.hasError().

error message

We tried a workaround (editing the control code manually and inserting the xml-formatted location-code from some 'old' component) and voila - the map preview is shown and also the folder-button to edit the location works.

manually providing location working location picker

Remarks/Questions:

  1. How do I debug the code of packages org.opencms.gwt.client and beyond? Unfortunatly the 'normal' debugging doesn't work here. At least it doesn't stop at the specified breakpoints in class CmsLocationController. For org.opencms.widgets.CmsLocationPickerWidget debugging works...
  2. The error message is a bit misleading since you can also provide the key via the location picker widget config in the XSD and even if it is provided correctly, the error is still shown...
Belarophon commented 7 years ago

Improved the workaround by specifying a default location in the top-level-XSD (the Location itself was located in a nested element):

Somehow the London-default value was not used.

tHerrmann commented 7 years ago

The commit above fixes the issue. It is no longer necessary to set a default value for the widget to work.

tHerrmann commented 7 years ago

The fix to this issue has been released with version 10.5.2.