Fix error in "States based on boolean form fields (checkboxes)" code example.
Investigating the problem I realized that the following error was being displayed in the DevTools console
drupal.js?v=10.2.4:64 Uncaught TypeError: Cannot read properties of undefined (reading 'include_path')
On line 525 of the file leaflet/js/leaflet.drupal.js :
lFeature = this.create_polygon(feature, map_settings ? map_settings['leaflet_markercluster']['include_path'] : false);
An error occurs if $map_settings['leaflet_markercluster'] does not have a value.
-
Fix the problem by adding 'leaflet_markercluster' => ['include_path' => FALSE, 'control' => FALSE],
in 'mymap' configuration.
function my_modulo_leaflet_map_info() {
return [
'MyMap' => [
'label' => 'My Map',
'description' => t('My map'),
'settings' => [
'center' => [
'lat' => '-40.41',
'lon' => '-64.69',
],
'dragging' => TRUE,
'touchZoom' => TRUE,
'scrollWheelZoom' => TRUE,
'doubleClickZoom' => TRUE,
'zoomControl' => TRUE,
'attributionControl' => TRUE,
'trackResize' => TRUE,
'fadeAnimation' => TRUE,
'zoomAnimation' => TRUE,
'closePopupOnClick' => TRUE,
'layerControl' => TRUE,
'layerControlOptions' => [
'position' => 'topright',
],
'leaflet_markercluster' => ['include_path' => FALSE, 'control' => FALSE],
],
'layers' => [
'earth' => [
// ...
],
],
],
'plugins' => [],
],
];
}
-
I think this should not be a required parameter.
abelpzl → created an issue.
hI!
There is still a lot of work to be done to get this theme working properly, it is in a very early stage of development.
I'm going to put a notice on the project page to let people know that it's not usable yet.
In the meantime I'm going to work on it.
-
Thanks for your interest :)
I am facing a similar problem
I need the folder where a file is saved to be formed with the id of a node related to the main node.
Something like this:
[node:field_a:entity:field_b:entity:field_c:entity:nid]
This works correctly in the drupal 7 version of this module but not in 8.x
Is there anything new?
What are the problems that need to be resolved for a stable version?
I am working on a migration of a site created in Drupal 7 to Drupal 10.
I use this module to create the path to a file with a custom token of type node. This token is responsible for determining in which path the file should be saved depending on the information on the node.
When importing the migrations I get an error as I do not have the files available in this instance.
It is not the same error as described in this issue but I believe it is related.
I think this module should ignore the entities that are being synchronized. It may be best to check it in filefield_paths_entity_insert().
I am attaching a patch
My problem was fixed by adding zoomControlPosition => topleft in the definition of my HOOK_leaflet_map_info().
function my_module_leaflet_map_info() {
return [
'my_map' => [
'label' => 'My Argentine map',
'description' => t('...'),
'settings' => [
// ...
'zoomControlPosition' => 'topleft',
// ...
],
],
'layers' => [ ... ],
'plugins' => [ ... ],
],
];
}
The following code works correctly in my case and marks three points on my map
$map_features = [
0 => [
'type' => 'point',
'lon' => '-60.292969',
'lat' => '-36.315125'
],
1 => [
'type' => 'point',
'lon' => '-63.632813',
'lat' => '-32.287133'
],
2 => [
'type' => 'point',
'lon' => '-65.566406',
'lat' => '-37.195331'
],
];
$map_info = \Drupal::service('leaflet.service')->leafletMapGetInfo()['my_map'];
$build['map'] = \Drupal::service('leaflet.service')->leafletRenderMap($map_info, $map_features, '450px');
#8 works correctly and I think it is the correct way.
I share a patch applicable to Drupal 10.2.2
I based it on the previous patches. Add a "Clear filter" button.
This patch solved my problem, but I haven't tested it enough to ensure it works correctly in all cases.
Is it possible that this filtering functionality will be part of the Core in the future?
I almost drove myself crazy trying to figure out why the empty field tag kept showing up. 😂
Thanks to #8 I understood what the problem was, by disabling branch debug mode the tag was finally hidden.
Shouldn't this work differently?
I had the same problem without using the Layout Builder module and I solved it by applying #2.
Can someone merge this? how can I help?
Patch #46 could not be applied in admin_toolbar 3.4.1 and drupal 9.5.10.
Instead #48 was applied correctly and seems to work correctly.
I share my solution to the errors named in
#28
✨
Taxonomy overview list with exposed filter
Active
This patch is applicable to D9.5.3
Keep in mind that in this patch I change the word comparison criteria with respect to the other patches.
-
In the future I would like to work on a custom module that adds the search to the list of terms. For the moment this solves my problem with a very long list of terms.
Testing 2975863-26-taxonomy-overview-filter.patch found it works well overall but reloading the form after performing a search produced the following errors:
Notice: Undefined offset: -1 in Drupal\taxonomy\Form\OverviewTerms->buildForm() (line 200 of core/modules/taxonomy/src/Form/OverviewTerms.php).
Notice: Undefined index: term in Drupal\taxonomy\Form\OverviewTerms->buildForm() (line 258 of core/modules/taxonomy/src/Form/OverviewTerms.php).
Notice: Trying to access array offset on value of type null in Drupal\taxonomy\Form\OverviewTerms->buildForm() (line 258 of core/modules/taxonomy/src/Form/OverviewTerms.php).
#42 is applied correctly in 9.5.3 and in my opinion works as expected.
Thanks for providing this solution.
#142 does work for me in 9.5.3 with php 7.4