Closed (fixed)
Project:
Simple Google Maps
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Mar 2017 at 11:42 UTC
Updated:
10 May 2017 at 07:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tjwelde commentedComment #3
martin107 commented@tjwelde
thanks for the patch - it looks like a good thing to do.
I have a couple of comments:
1) The addition of SafeMarkup::checkPlain($address_value) is redundant as twig auto escapes variables by default.
2)As a way of double checking the patch ... I looked for a one-to-one correspondence between your list in
config/schema/simple_gmap.schema.yml
and the list in SimpleGMapFormatter::defaultSettings()
The following are missing:
static_scale
apikey
Comment #4
tjwelde commentedoh ^^ forgot to rebase before diffing.
This patch is rebased and has the other settings included.
Comment #5
geekinpink commentedI reviewed patch below patch file. Its working fine.
simple_gmap_schema
Comment #6
martin107 commented@geekinpink thank you, I will take that as an RTBC.
I will take a close look and hopefully commit soon....
Comment #7
martin107 commentedOn final review I find that I have an unanswered question, I hope it is a simple matter of correcting a misunderstanding I may have.
As it says in the issue summary there is a tool useful in debugging schemas
When I try and use it to check the schema - I do not see things as I expect.
so with simple_map and config_schema enabled I visit
admin/config/development/configuration/inspect
when I search for our new config_key [field.formatter.settings.simple_gmap] and I fail to find it ....
Am I doing something wrong .....
Have we made a error in the schema definition such that the system is not recognising it?
Comment #8
jhodgdonWe should not have any config files, only config schema, in the config directory of this module. I don't know anything about the tool, but if it is looking for something in config/install or config/optional, it isn't going to find anything, and it shouldn't.
What should happen is that if you have a site with a field using our formatter, that should create a config entry for that field formatter... Which I think is part of the display mode, not its own config item.
I also reviewed the patch and there are quite a few labels that need some work:
This line is incorrect. This was probably copied from a Link field? It should say something like settings for the simple google map field.
a text => text
wrong label, this is the zoom level
not really "default"?
comma should be removed
Comment #9
jhodgdonSorry, item 3 above isn't clear. Also I found one other problem:
This seems to be a typo, I don't think it ends in ,
And here's the context on item 3 from the previous comment.
Comment #10
mtodor commentedNice work and very good detailed review!
I have addressed everything from #8 and #9. Patch and interdiff provided.
@jhodgdon regarding zoom level label (#8.3 and #9.2), I have googled a bit and I didn't find any more descriptive label for it, looks like "Zoom level" is sufficient. Also same label is used in formatter settings form.
Comment #11
mtodor commentedComment #12
jhodgdonSorry I wasn't clear. The problem was that the Zoom Level item in the schema had a description saying 'Height of embedded map', which you have fixed -- the new description of "Zoom level" also seems fine to me.
Now, one more thing -- sorry for missing this earlier!
There is a distinction in schema files between text that can be translated using Config Translation (type: label) and text that cannot be translated (type: string). See:
https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
So, 'string' type is not translatable, and 'label' type is. Some of the items in this schema file should be 'label', so that if the field is displayed in a different language, that setting can be different in those other languages.
The two that I think need to be type 'label' are 'link_text' and 'langcode'.
Thanks!
Comment #13
mtodor commented@jhodgdon I didn't know about that. Thanks for info.
Btw. In my opinion translation of "langcode" without additional context can lead to unexpected results, that's why it would be good to also provide context for that configuration option. You can find patch with proposal for that too (one with "_with_context" in name).
Comment #14
jhodgdonI did not know about translation context in schema -- great idea! I think the "with context" patch should be chosen here. Thanks!
Comment #16
martin107 commentedThank you all, fixed.
Comment #18
tjwelde commented@martin107 Could you please make a new release?
Comment #19
martin107 commentedI am comfortable with that ... here is our shiny new 8.x-1.3 release
https://www.drupal.org/project/simple_gmap/releases/8.x-1.3
Comment #20
tjwelde commentedYey! Thanks ;)