coderedcms icon indicating copy to clipboard operation
coderedcms copied to clipboard

Structured Data Error using Geographic coordinates

Open pascalthivierge opened this issue 4 years ago • 5 comments

Describe the bug

There seems to be a problem with Json output using coordinates. The coordinates are added to the structured data, but I think that the comma breaks the JSON output.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to SEO tab in page.
  2. Enter geographic coordinates under STRUCTURED DATA - ORGANIZATION

Expected behavior

When I enter coordinate like 15.43929432, it is saved as 15,43929432. Shouldn't it keep a decimal format using "." ?

pascalthivierge avatar Jul 03 '20 18:07 pascalthivierge

I get an error from the Google Search Console : "Missing ‘}’ or object member name". Only when I use geographic coordinates.

pascalthivierge avatar Jul 06 '20 13:07 pascalthivierge

What browser are you using, and what is the locale? I'm guessing the browser might be transforming this value.

vsalvino avatar Jul 06 '20 14:07 vsalvino

Yes, french locale.

Would it be possible to restrict the field format to dot decimal notation?

pascalthivierge avatar Jul 06 '20 15:07 pascalthivierge

I'm using Wagtailtrans.

The problem only concern the french page. It seems that regardless the browser's locale, the value entrered with decimal point is somehow converted to decimal comma.

pascalthivierge avatar Jul 16 '20 14:07 pascalthivierge

Would you be able to test this out on a plain wagtail project with wagtailtrans, and see if the issue persists without coderedcms?

An example model that should trigger the issue:

from django.db import models
from wagtail.core.models import Page
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel

class TestPage(Page):
    decimal_field = models.DecimalField(
        blank=True,
        null=True,
        max_digits=10,
        decimal_places=8,
        verbose_name=_('Decimal Field')
    )
    content_panels = Page.content_panels + [
        MultiFieldPanel([
            FieldPanel('decimal_field'),
        ])
    ]

vsalvino avatar Jul 17 '20 05:07 vsalvino