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

HRIN-767: Added GIS map token #376

Merged
merged 3 commits into from
Dec 20, 2023
Merged

HRIN-767: Added GIS map token #376

merged 3 commits into from
Dec 20, 2023

Conversation

rimi-itk
Copy link
Contributor

@rimi-itk rimi-itk commented Dec 18, 2023

https://jira.itkdev.dk/browse/HRIN-767

Adds GIS map token for use in hearing descriptions.

Editor view

Screenshot 2023-12-19 at 13 44 47

Frontend display

Screenshot 2023-12-18 at 13 39 19

Important note on updating

We have an issue with “plandata” that is used somewhere:

https://geoserver.plandata.dk/geoserver/wfs?request=GetFeature&typeNames=pdk%3Alokalplan&srsName=EPSG%3A4326&outputFormat=application%2Fjson&cql_filter=planid%20IN%20%289417152%29&servicename=wfs&service=wfs&version=2.0.0:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 https://geoserver.plandata.dk/geoserver/schemas/ows/1.1.0/owsAll.xsd">
 <ows:Exception exceptionCode="InvalidParameterValue" locator="typeName">
  <ows:ExceptionText>Feature type pdk:lokalplan unknown</ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

which makes hoeringsportal_hearing_update_9001 fail.

Therefore, we manually apply the text format update and skip the update hook:

# Update hearing description text format.
docker compose exec phpfpm vendor/bin/drush sql:query "UPDATE node__field_description SET field_description_format = 'hearing_description' WHERE bundle = 'hearing';"
# Skip the update hook.
docker compose exec phpfpm vendor/bin/drush php:eval "\Drupal::service('update.update_hook_registry')->setInstalledVersion('hoeringsportal_hearing', 9001);"
# Run the real update.
docker compose exec phpfpm vendor/bin/drush --yes deploy

@rimi-itk rimi-itk force-pushed the feature/HRIN-767-gis-map branch 2 times, most recently from bf37851 to 2273c8a Compare December 18, 2023 12:44
@rimi-itk rimi-itk marked this pull request as ready for review December 18, 2023 12:48
@rimi-itk rimi-itk force-pushed the feature/HRIN-767-gis-map branch 6 times, most recently from ba841f6 to 7475eda Compare December 19, 2023 16:08
@rimi-itk rimi-itk changed the base branch from feature/drupal-10 to develop December 20, 2023 09:32
module:
- token_filter
name: 'Hearing description'
format: hearing_description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth a change, but generally i'm not sure our filters should be attached to specific fields or entities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [gis:minimap:?] token makes sense only in the hearing description field, and therefore a new text format with the token filter has been added.

@rimi-itk rimi-itk merged commit aa19405 into develop Dec 20, 2023
@rimi-itk rimi-itk deleted the feature/HRIN-767-gis-map branch December 20, 2023 09:43
@rimi-itk rimi-itk mentioned this pull request Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants