feat: #3643052: ECA action to set a district/term reference from a location Geofield

Summary

The "Geofield: assign containing entity reference" action (eca_geofield_assign_containing_reference) and PostgisService::findEntityIdByRelation() are already on 1.0.x (see #3638392). This merge request adds the documentation that issue left open. It changes no PHP code, config schema or tests.

Changes

  • docs/for-site-builders.md: the action is listed in the overview table (now six actions), with a configuration section that covers every field, the spatial operators, the smallest-area rule, the SRID limitation, the "clear when nothing matches" option and an example presave model.
  • docs/for-developers.md: notes that findEntityIdByRelation() ignores the SRID on both sides, in contrast to centroidOfFieldValues().
  • docs/for-testers.md: new Part 7 with a manual test. It uses a district vocabulary with a PostGIS boundary field, a term reference on a node, a province polygon that contains the districts (to check that the smallest area wins) and the clear option.

How to test

  1. Follow Part 7 of docs/for-testers.md on a site with PostGIS.
  2. Run the module test suite: SIMPLETEST_DB=pgsql://db:db@db/db vendor/bin/phpunit -c web/core/phpunit.xml.dist web/modules/contrib/eca_geofield/tests/ Result: 67 tests, 628 assertions, no failures. The one deprecation notice comes from contrib dependencies, not from this module.
  3. vendor/bin/phpcs --standard=Drupal,DrupalPractice web/modules/contrib/eca_geofield reports no errors for the PHP files. phpstan level 6 still reports the errors that existed before; none are in the new action.

Open questions from the issue

  • Whether to honour the SRID is not changed here. The docs describe the current behavior (SRIDs are ignored, both sides must share a coordinate system).

AI assistance

An AI coding assistant helped draft the documentation and run the checks. I reviewed the changes and take responsibility for them.

Closes #3643052

Merge request reports

Loading
Loading