Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It happens that isBaseLayer gets to be a string rather than a bool.
This breaks some GeoExt (and I'm sure will break OL too one day, when performance tweaks are in, as === is faster than ==).
So, tracking this back seems to suggest the string originates from a #return_vaulue = 'true' in wms.inc forms.
Why was it made so ?
I'd cast to bool on use, to support old exportables, but I think we'd need a way for exportables to be checked before being
written in DB, to do these kind of cleanups in an easier way.
Comments
Comment #1
strk CreditAttribution: strk commentedI found out that #return_value type was changed by commit http://drupal.org/cvs?commit=408332
performed by tmwc. Patch came from batje in http://drupal.org/node/878644
Comment #2
strk CreditAttribution: strk commentedThe rationale for that #return_value change is reported to be here: http://drupal.org/node/862690
Comment #3
strk CreditAttribution: strk commentedCommit http://drupal.org/cvs?commit=423660 casts isBaseLayer to boolean before sending to javascript, so to support ruined layer exportables produced after commit http://drupal.org/cvs?commit=408332
Next I'd like to revert the portion of commit 408332 which had nothing to do with the issue the commit references, that
is the #return_value thing.
Comment #4
strk CreditAttribution: strk commentedNote that http://drupal.org/node/862690, referenced by http://drupal.org/node/878644 to justify the #return_value change,
is closed by commit http://drupal.org/cvs?commit=403394 which actually _introduced_ #return_value with proper value (TRUE)
http://drupalcode.org/viewvc/drupal/contributions/modules/openlayers/inc...
So, there's where I'll put the code again.
Writing malformed exportables is a very bad idea.
In addition to the cast, if we want to support a migration from old exportables to new ones, we might need
to also apply the cast to every use of old presets (annoying)
Comment #5
strk CreditAttribution: strk commentedCommitted the #return_value revert in http://drupal.org/cvs?commit=423674