Canvas Map adds Google Maps and OpenStreetMap components to Drupal Canvas. Each provider is a submodule with its own component, and editors place maps in Canvas page layouts. The Google API key comes from a Key module entity.
Differences with similar projects
- Geofield, Geofield Map and Leaflet store locations as field data on entities, with map widgets, formatters and Views displays, used when a site manages structured geographic data.
- Map provider is for developers: a plugin type for map tile sources defined in YAML, and a
map render element that draws a Leaflet map from PHP.
Canvas Map stores no geographic data and adds no field, widget, Views display or JavaScript map API. Each provider is a placeable Canvas component that renders the map service's own embed in an iframe, and editors add a single map to a page without writing code.
Project link
https://www.drupal.org/project/canvas_map
Manual reviews of other projects
AI-Generated: Yes, module is being written with AI coding agents. We direct the work and review every commit.
Comments
Comment #2
davituri commentedComment #3
nickolajHi,
I reviewed the
1.0.xbranch of Canvas Map.Manual read of the iframe path, Key handling, CSP subscribers, templates, and
.gitattributes. I saw the note that the module is written with AI coding agents. I treated the iframesrcand the API key as the places that had to be right.Both providers hard-code an
https://endpoint (GoogleMapsEmbed::ENDPOINT,OsmEmbed::ENDPOINT) and appendUrlHelper::buildQuery(). Location, zoom, map type, and region are gated before they go into the query. The Google key comes from a Key entity, not from exportable config.administer canvas maphasrestrict access: true.templates/canvas-map-iframe.html.twigprintssrcandtitlethrough Twig autoescape and skips the iframe entirely whensrcis empty, sosrc=""cannot load the current page. I did not find|rawon those values..ddev/is in the git tree but listed asexport-ignorein.gitattributes, with a comment that Drupal.org tarballs usegit archive. That is the right way to keep a local toolchain out of the packaged module.README and
docs/privacy.mdstate that the visitor's browser talks to Google or OpenStreetMap on page load, and that the Embed API key is visible in the iframe URL. That matches the code.Branch
1.0.x, Drupal^11.3, enough PHP, no vendor JS committed. I have no blocking findings.One optional note, not a request to change status: the Google
qparameter is the editor-supplied location, passed through unparsed (as the Embed API wants). That is fine for Canvas editors. It is worth keeping the "editors can place maps" permission model in mind if Canvas ever exposes these components to less trusted roles.Comment #4
avpadernoComment #5
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #6
avpadernosrc/Form/CanvasMapSettingsForm.php
The class seems to be for plugin settings. In fact, it even has
MapProviderPluginManageras dependency.ConfigFormBaseis not the right base class to use in that case.Comment #7
davituri commentedThank you both for the reviews.
src/Form/CanvasMapSettingsForm.php
The form edits one simple configuration object,
canvas_map.settings, declared as aconfig_objectin the module's schema so that is why it extendsConfigFormBase. The providers do not own that configuration, each plugin contributes the elements of its own section throughPluginFormInterfaceand the form stores the submitted values under theproviderskey, by plugin id.Core has the same shape in
\Drupal\system\Form\ImageToolkitForm: it extendsConfigFormBase, takesImageToolkitManagerin its constructor and callsbuildConfigurationForm(),validateConfigurationForm()andsubmitConfigurationForm()on each toolkit.\Drupal\language\Form\NegotiationConfigureFormalso extendsConfigFormBasewith a plugin manager injected. The change record for#config_targetsays the new mechanism is optional and existing simple configuration forms continue to work as they are. This form cannot use it, because the elements come from the plugins.@avpaderno I could not find documentation that names a different base class for a settings form that hosts plugin forms. If you have one in mind, please point me to it and I will change the class.
Comment #8
vishal.kadamRemember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.
Comment #9
avpadernoUsually, plugins that use configuration implement at least a couple of interfaces, one for the configuration and one for the exposed form. That should have been done for image toolkits too. Probably, at the time image toolkits were converted to plugins, there was no interface for plugins with configuration.
Comment #10
avpaderno@vishal.kadam I take the status was not changed because a reply was expected from me.
Comment #11
avpadernoThe interfaces for configurable plugins are
\Drupal\Core\Plugin\PluginFormInterfaceand\Drupal\Component\Plugin\ConfigurableInterface.Comment #12
davituri commented@avpaderno Thanks, it's clear now. Done in this commit on 1.0.x:
MapProviderSettingsInterfaceextendsPluginFormInterfaceandConfigurableInterface.EmbedIframeProviderBaseextendsConfigurablePluginBase, so providers getgetConfiguration()and others from core.GoogleMapsEmbeddeclaresdefaultConfiguration()and writes the submitted values to its configuration insubmitConfigurationForm().CanvasMapSettingsFormnow stores each plugin'sgetConfiguration()instead of the form values. A new kernel test covers that.The form itself still extends
ConfigFormBase: it edits the simple configuration objectcanvas_map.settings, and now stores each plugin's configuration there, asImageToolkitFormstores the chosen toolkit insystem.image. Please let me know if you see it differently.