Skip to content

Commit 20c7824

Browse files
authored
Merge pull request #344 from itk-dev/feature/switch-dompdf
Feature/switch dompdf
2 parents 610d1eb + 31d4098 commit 20c7824

23 files changed

+368
-423
lines changed

CHANGELOG.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,38 @@ Versioning](https://semver.org/spec/v2.0.0.html).
88

99
## [Unreleased]
1010

11-
- [PR-341](https://github.com/itk-dev/os2loop/pull/341): Notify of collection changed when document is changed.
11+
- [PR-341](https://github.com/itk-dev/os2loop/pull/341):
12+
Notify of collection changed when document is changed.
1213

13-
## [feature/update-drupal-and-php]
14+
## [feature/update-drupal-and-php] - 2023-08-25
15+
16+
- Switch to dompdf
1417
- Upgrade drupal core (9.5.10)
1518
- Upgrade contrib module
16-
- Change code analysis tool (drupal-check -> phpstan for more configuration options)
19+
- Change code analysis tool
20+
drupal-check -> phpstan for more configuration options
1721
- Update custom modules with phpcs and phpstan tools.
1822
- Update configuration to match drupal upgrade.
1923
- Upgrade docker setup to use php 8.1
2024

2125
## [develop]
22-
- [LOOP-862](https://jira.itkdev.dk/browse/LOOP-862): Added documentation for modules and hooks.
26+
27+
- [LOOP-862](https://jira.itkdev.dk/browse/LOOP-862): Added documentation for
28+
modules and hooks.
2329
- [LOOP-947](https://jira.itkdev.dk/browse/LOOP-947): Styling user profile page
24-
- [LOOP-948](https://jira.itkdev.dk/browse/LOOP-948): Fix position of user dropdown menu, that extends outside the viewport on narrow screens.
30+
- [LOOP-948](https://jira.itkdev.dk/browse/LOOP-948): Fix position of user
31+
dropdown menu, that extends outside the viewport on narrow screens.
2532
- [LOOP-950](https://jira.itkdev.dk/browse/LOOP-950): Styling of messages list
26-
- [LOOP-949](https://jira.itkdev.dk/browse/LOOP-949): Styling of subscriptions page
33+
- [LOOP-949](https://jira.itkdev.dk/browse/LOOP-949): Styling of subscriptions
34+
page
2735
- [LOOP-732](https://jira.itkdev.dk/browse/LOOP-732),
2836
[LOOP-733](https://jira.itkdev.dk/browse/LOOP-733) and
2937
[LOOP-734](https://jira.itkdev.dk/browse/LOOP-734): Drupal, SAML and OpenID
3038
Connect login
3139
- [LOOP-874](https://jira.itkdev.dk/browse/LOOP-874): Fine-grained
3240
administrator permissions.
3341
- [LOOP-934](https://jira.itkdev.dk/browse/LOOP-934): Several changes to design
34-
- [LOOP-809](https://jira.itkdev.dk/browse/LOOP-809): Changed search settings, Add tagging to media library, fix bugged file reference in display
35-
- [LOOP-968](https://jira.itkdev.dk/browse/LOOP-968): Remove Connected accounts tab
42+
- [LOOP-809](https://jira.itkdev.dk/browse/LOOP-809): Changed search settings,
43+
Add tagging to media library, fix bugged file reference in display
44+
- [LOOP-968](https://jira.itkdev.dk/browse/LOOP-968): Remove Connected accounts
45+
tab

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"php": "^8.1",
4141
"composer/installers": "^1.9",
4242
"cweagans/composer-patches": "^1.7",
43+
"dompdf/dompdf": "^2.0.1",
4344
"drupal/adminimal_theme": "^1.6",
4445
"drupal/autocomplete_deluxe": "2.0.0",
4546
"drupal/better_formats": "1.x-dev",
@@ -87,8 +88,7 @@
8788
"drupal/views_flag_refresh": "dev-2929394-drupal-8-port",
8889
"drupal/viewsreference": "^2.0",
8990
"drupal/xls_serialization": "^1.2",
90-
"drush/drush": "^10.4",
91-
"mikehaertl/phpwkhtmltopdf": "^2.5"
91+
"drush/drush": "^10.4"
9292
},
9393
"scripts": {
9494
"post-install-cmd": [
@@ -229,6 +229,9 @@
229229
},
230230
"drupal/view_unpublished": {
231231
"Grants are not cached if the user has \"view any unpublished content\" permission (https://www.drupal.org/project/view_unpublished/issues/3226756)": "https://www.drupal.org/files/issues/2021-08-04/view_unpublished-cache_ignored-3226756-2-8.x.patch"
232+
},
233+
"drupal/entity_print": {
234+
"Add page count https://www.drupal.org/project/entity_print/issues/2823430": "https://www.drupal.org/files/issues/2023-07-10/entity_print-dompdf_page_count-2823430-14.patch"
232235
}
233236
}
234237
},

composer.lock

Lines changed: 2 additions & 143 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/sync/core.entity_view_display.paragraph.os2loop_documents_table.default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ content:
2424
region: content
2525
os2loop_documents_tbl_desc:
2626
type: basic_string
27-
label: visually_hidden
27+
label: hidden
2828
settings: { }
2929
third_party_settings: { }
3030
weight: 2

config/sync/entity_print.print_engine.dompdf.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ dependencies: { }
55
id: dompdf
66
settings:
77
default_paper_size: a4
8+
default_paper_orientation: portrait
89
username: ''
910
password: ''
1011
enable_html5_parser: true
1112
enable_remote: true
13+
font_subsetting: true
14+
embedded_php: false
1215
cafile: ''
1316
verify_peer: true
1417
verify_peer_name: true
1518
disable_log: 0
16-
default_paper_orientation: portrait

config/sync/entity_print.settings.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ _core:
33
default_css: false
44
force_download: true
55
print_engines:
6-
pdf_engine: phpwkhtmltopdf
6+
pdf_engine: dompdf
77
epub_engine: ''
88
word_docx_engine: ''
9+
base_url: ''

config/sync/os2loop_flag_content.settings.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"prettier": "^2.2.1"
88
},
99
"scripts": {
10-
"coding-standards-check/markdownlint": "markdownlint README.md 'docs/**/*.md' 'web/profiles/custom/os2loop/**/*.md' --ignore 'web/profiles/custom/os2loop/**/node_modules/**/*.md'",
10+
"coding-standards-check/markdownlint": "markdownlint CHANGELOG.md README.md 'docs/**/*.md' 'web/profiles/custom/os2loop/**/*.md' --ignore 'web/profiles/custom/os2loop/**/node_modules/**/*.md'",
1111
"coding-standards-check/prettier": "prettier --check \"web/profiles/custom/os2loop/themes/os2loop_theme/assets/**/*.{js,scss}\"",
1212
"coding-standards-check": "yarn coding-standards-check/markdownlint && yarn coding-standards-check/prettier",
1313
"coding-standards-apply/markdownlint": "markdownlint --fix README.md 'docs/**/*.md' 'web/profiles/custom/os2loop/**/*.md' --ignore 'web/profiles/custom/os2loop/**/node_modules/**/*.md'",

web/profiles/custom/os2loop/modules/os2loop_documents/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ We use [Entity Print](https://www.drupal.org/project/entity_print) for
1414
printing documents and collections, i.e converting them to PDF.
1515

1616
Entity Print is configured to use
17-
[`phpwkhtmltopdf`](https://github.com/mikehaertl/phpwkhtmltopdf) for converting
18-
HTML to PDF, and in order to make this work you need a working installation of
19-
wkhtmltopdf 0.12.6 (see
20-
<https://github.com/mikehaertl/phpwkhtmltopdf#installation-of-wkhtmltopdf>)
21-
available as `/usr/local/bin/wkhtmltopdf`.
17+
[`dompdf`](https://github.com/dompdf/dompdf) for converting
18+
HTML to PDF.
2219

23-
If need be, you can override the path to the `wkhtmltopdf` binary in
24-
`settings.local.php`, e.g.:
20+
### Assets in Docker
21+
22+
When using docker we need to help phpfpm locate assets. We use an event
23+
subscriber to alter the pdf and use our custom base url. The base url is defined
24+
in settings.php
2525

2626
```php
27-
$config['entity_print.print_engine.phpwkhtmltopdf']['settings']['binary_location'] = '/opt/wkhtmltopdf/wkhtmltopdf';
27+
$settings['pdf_custom_base_url'] = 'http://nginx:8080/';
2828
```
2929

3030
### Debugging entity print input

web/profiles/custom/os2loop/modules/os2loop_documents/os2loop_documents.services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ services:
2626
Drupal\os2loop_documents\EventSubscriber\EntityPrintEventSubscriber:
2727
tags:
2828
- { name: event_subscriber }
29+
arguments: ['@request_stack']
2930

3031
Drupal\os2loop_documents\Helper\UpdateHelper:
3132
arguments:

0 commit comments

Comments
 (0)