If 'feature_limit' option is set to 0, then any drawn features disappear immediately. This is due to the 'event.feature.layer.removeFeatures' method call on 'featureadded' event type. Which in turn is due to the fact that 'behavior.feature_limit' is string, so has the bool value 'True'. Thus the condition (event.type == 'featureadded' && behavior.feature_limit && $(behavior.feature_limit < event.object.features.length) is always performed for the corresponding operation.

CommentFileSizeAuthor
#1 ole-immediate_removal-2263331.patch694 bytesyevhen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yevhen’s picture

DrupaListo.com’s picture

you are right in principle:

"0" is a string, and since it's not empty, it's evaluated to true

but in current module version 7.x-1.1, the behavior.feature_limit is a js null value when the cck field cardinality is unlimited.

So this bug is not dangerous imho, but needs 1-2 mins thought from lead maintainer and then commit/skip and mark issue as wont fix/fixed.

Cheers.