Hi I'm wondering if it's possible to increase the length of the base URL field for the layer settings. I often run into trouble because of truncated URLs.

Files: 
CommentFileSizeAuthor
#1 1512486-01.openlayers.wmsurllength.patch1.53 KBekes
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Comments

ekes’s picture

StatusFileSize
new1.53 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

The field is stored serialized in the data text field of the {openlayers_layers} table, so there is plenty of space, and no constraint other than the form field and validation. 2083 characters seems a common maximum for URLs, although though they could be longer. So suggest patch attached (or even larger?).

ekes’s picture

Status:Active» Needs review
ekes’s picture

Version:7.x-2.0-beta1» 7.x-2.x-dev
Pol’s picture

Thanks @ekes ! Patch committed ;-)

I had to do it manually because your patch was containing stuff from #1491314: Redundant indexes on Styles and Layers tables.

Pol’s picture

Status:Needs review» Fixed
de_chris’s picture

Hi, thanks. Can I update to the latest dev or do I have to patch?

de_chris’s picture

Status:Fixed» Needs review

Hi, I tried the latest dev (2012-Aug-28) but there is a new problem. The WMS Base URL field remains empty now. I've created a new issue for that (http://drupal.org/node/1761768) since it might be an other problem.

Pol’s picture

Status:Needs review» Fixed

Hello,

Can you check again with the dev version ?

Thanks.

de_chris’s picture

Status:Fixed» Needs work

Hi, thanks for the fast reply. In the latest dev version the WMS Base URL field contains now the URL. So the issue with the empty field is solved. But the problem of this thread remains since I still can't insert URLs with more than 128 characters.

Pol’s picture

Status:Needs work» Fixed

Hello @de_chris,

I just tested and it works pretty good, the base layer is not trimmed or altered.

Steps I did:

  1. Create a new WMS layer
  2. Copy paste a string with 160 char for the Base URL
  3. Save
  4. Edit the newly created layer.
de_chris’s picture

Hello @Pol,
I also tested it with a new layer and it works. The restrictions only remain when editing or cloning existing layers. Thanks a lot.

Pol’s picture

Status:Fixed» Needs work

Weird, I'll fix that tonight. Thanks for the report.

Pol’s picture

Status:Needs work» Fixed

Hello @de_chris,

I wasn't able to reproduce the problem even by editing the layer.

de_chris’s picture

Hi my steps to reproduce:
edited an existing layer created with an older OL-Version; replace existing url by:tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt; copied the sting in the field and got:tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
but thats not a great problem since I can now create new layers with more than 128 long urls.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

japo32’s picture

Thanks. I used the same fix for a new XYZ Layer. :)

        '#type' => 'textfield',
        '#title' => t('Base URL (template)'),
        '#maxlength' => 2083,
        '#default_value' => isset($this->data['url']) ?
          $this->data['url'] : '',
        '#description' => t('This is the base URL template for the XYZ layer.  It should be something similar to <em>http://example.com/tiles/1.0.0/layer_name/${z}/${x}/${y}.png</em>.'),

in openlayers_layer_type_xyz.inc

Pol’s picture

Thanks, I did it on 7.x-2.x too.