Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured Data Error using Geographic coordinates #326

Open
pascalthivierge opened this issue Jul 3, 2020 · 5 comments
Open

Structured Data Error using Geographic coordinates #326

pascalthivierge opened this issue Jul 3, 2020 · 5 comments
Labels
Type: Bug Something isn't working

Comments

@pascalthivierge
Copy link

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 pascalthivierge added the Type: Bug Something isn't working label Jul 3, 2020
@pascalthivierge
Copy link
Author

pascalthivierge commented Jul 6, 2020

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

@vsalvino
Copy link
Contributor

vsalvino commented Jul 6, 2020

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

@pascalthivierge
Copy link
Author

Yes, french locale.

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

@pascalthivierge
Copy link
Author

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.

@vsalvino
Copy link
Contributor

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'),
        ])
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants