better handling of bad personal-note-coordinate input; updates #169

This commit is contained in:
following 2015-05-25 16:17:12 +02:00
parent 1df52c4914
commit 1321fe6566
2 changed files with 13 additions and 2 deletions

View File

@ -58,7 +58,12 @@ class CacheNote_Presenter
$this->request->validate(self::req_note, new Validator_AlwaysValid());
if ($this->includeCoordinate())
return $coordinateValid = $this->coordinate->validate();
{
$this->coordinate->validate();
// Removed false-return for invalid coordinate, so that at least the note will be saved.
// validate() produces some formal valid coordinate.
// -- following 25 May 2015
}
else
$this->coordinate->init(0, 0);

View File

@ -331,7 +331,7 @@
<!-- Personal Note -->
{if $enableCacheNote}
<div class="content2-container bg-blue02">
<div class="content2-container bg-blue02" id="personal_note">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/description/20x20-cache-note.png" style="align: left; margin-right: 10px;" alt="{t}Personal cache note{/t}" />
{t}Personal cache note{/t}
@ -537,5 +537,11 @@
</script>
{/if}
{if $enableCacheNote && isset($coord_error)}
<script type="text/javascript">
document.getElementById('personal_note').scrollIntoView();
</script>
{/if}
<!-- End Logs -->
{/if} {* not $show_logpics *}