🇬🇧United Kingdom @andreastkdf

Account created on 16 December 2019, over 5 years ago
#

Merge Requests

More

Recent comments

🇬🇧United Kingdom andreastkdf

confirming that the pacth #51 📌 Consider adding a hook to Paragraphs::getSummary RTBC and MR work on:

  • Drupal: 10.4.5
  • Paragraphs: 1.19.0

In our case we use a ParagraphSummarySubscriber to alter paragraphs summary based on custom conditions, which works as expected using ParagraphSummaryAlterEvent

🇬🇧United Kingdom andreastkdf

fyi this is now rebased and last commit also includes an additional fix - needs review :)

🇬🇧United Kingdom andreastkdf

Thanks scott_euser for the last addition fixing the issues in custom forms behaviour and for explaining what still needs work on this issue.

Sorry for the MR above (that I now closed), please ignore (I wanted to make an MR targeting 10.4.x, but this is not needed, the diff from the active MR is applying on 10.4.x too)

🇬🇧United Kingdom andreastkdf

andreastkdf changed the visibility of the branch 2842525-10.4.x to hidden.

🇬🇧United Kingdom andreastkdf

andreastkdf made their first commit to this issue’s fork.

🇬🇧United Kingdom andreastkdf

Thanks for the great addition @DieterHolvoet!

Testing this on an existing site using the module

This is after using the patch and running drush updb, which runs the hook:
10002 - Set default value for new 'method' option.

  • New PDF generation happens options on the content type Edit page. Very minimal,
    but maybe the wording needs to be updated here? Maybe something like:
    Should the PDF be generated? or PDF generation mode
    (and update the option labels from to Manual, ...
    and to Automatic, ...).
  • The "Manually, after clicking the 'Save and generate PDF' button" option is selected by default.

Default behaviour - without any change in the settings - using default
Manually, after clicking the 'Save and generate PDF' button.

  • ✓ Live PDF preview works.
  • ✓ "Save and Generate PDF" button is available on the content item.
  • ✓ "Save and Generate PDF" works as usual; generates the PDF and saves it to the configured destination media document field.

New behaviour - using Automatically, when the node is saved.

  • ✓ Can we also add this new method on the module page after it's merged?
  • Submit button label is removed on the content type Edit page.
  • ✓ Made a small change, saved the node, and ran cron. PDF generation job worked; it generates the PDF and saves it to the configured destination media document field.
  • ✗ Issue with translations:

    I followed the same steps for a node with multiple translations and noticed that saving translations does not add the job to the queue. This means separate translated PDFs are not being generated, unlike with the manual option.

    For example:

    1. ✗ On a node with multiple translations, I edited a translation, saved it, and then ran cron.

      Result: The "translated" PDF was not generated.
    2. ✓ By comparison, using the manual option:

      On the same node, I edited a translation and clicked Save and Generate PDF.

      Result: The PDF was generated for the current translation and updated the translatable destination media document field.

    The behaviour of the automatic option should match the manual option, where saving a translation triggers the generation of the corresponding translated PDF.

🇬🇧United Kingdom andreastkdf

Changed back to targetting 8.x-2.x-dev as the tests failed (when using 3.x.dev they were ruining on D11, and the module is not compatible)

some one with access should re-trigger the test manually

🇬🇧United Kingdom andreastkdf

Full error (sorry missed the first important bit of it on my previous comment):

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\form_mode_manager_theme_switcher\Theme\FormModeThemeNegociator->isApplicable() (line 93 of modules/contrib/form_mode_manager/modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php).

🇬🇧United Kingdom andreastkdf

Full error (sorry, missed the first bit in the previous comment)

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\form_mode_manager_theme_switcher\Theme\FormModeThemeNegociator->isApplicable() (line 93 of modules/contrib/form_mode_manager/modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php).

🇬🇧United Kingdom andreastkdf

I can also confirm that this works great; I managed to see the Translation overview and get to the translation form! Thank you! BUT when on the actual translation form, an error is now showing:

Drupal\form_mode_manager_theme_switcher\Theme\FormModeThemeNegociator->isApplicable() (line 93 of modules/contrib/form_mode_manager/modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php).

We need a check on $route->getDefault('_entity_form') inside the str_replace in case the route default is not set (for example, when adding a translation) and $route->getDefault('_entity_form') returns NULL which causes the deprecation error above.

Just pushed a commit to the MR containing a check that fixes the deprecated error.

🇬🇧United Kingdom andreastkdf

andreastkdf made their first commit to this issue’s fork.

🇬🇧United Kingdom andreastkdf

Added MR targeting 10.x: ensures we skip a task before rendering if necessary properties are missing.

🇬🇧United Kingdom andreastkdf

added a new MR to re-roll for 10.3.x (this still needs to be rerolled for 11.x)

🇬🇧United Kingdom andreastkdf

andreastkdf changed the visibility of the branch 333177 to active.

🇬🇧United Kingdom andreastkdf

See MR instructing Drupal to load paged.js without preprocessing.

This doesn't fix all issues, and AdvAgg (when stable for Drupal 10) could be a recommendation on the project page, for site admins to disable all aggregation on /pdf pages but it makes sense to have it disabled at least for the library we include with this module.

🇬🇧United Kingdom andreastkdf

added a new MR for 10.3.x but agree about this needing to be rerolled for 11.x

The MR9471 basically contain both #6 🐛 OEmbed fails to save if thumbnail fails to download Needs work and #7 🐛 OEmbed fails to save if thumbnail fails to download Needs work . A note about #7 🐛 OEmbed fails to save if thumbnail fails to download Needs work : RessourceFetcher calls createResource which calls Resource:rich too, so the fix on #6 🐛 OEmbed fails to save if thumbnail fails to download Needs work is needed to fix the ValueError: Path cannot be empty in file_get_contents()error.

🇬🇧United Kingdom andreastkdf

andreastkdf changed the visibility of the branch 3331771-oembed-fails-to to hidden.

🇬🇧United Kingdom andreastkdf

andreastkdf changed the visibility of the branch 10.3.x to active.

🇬🇧United Kingdom andreastkdf

tested on site using the module for both doppio and browserless

🇬🇧United Kingdom andreastkdf

thanks @man-1982 for sorting out the commit, I just rebuild the assets to make sure all the generated js and css was up to date. It looks like your sorted it out, sorry for the confusion,

About applying the MR as a patch, you can indeed use the plain diff ( documentation here - note the difference between the two options on the MR (Diff and Patch) and what to use ), so you basically either:

🇬🇧United Kingdom andreastkdf

thanks Scott! yes, I've tested with both services :)

🇬🇧United Kingdom andreastkdf

Following https://www.drupal.org/project/page_to_pdf/issues/3459121 📌 Refactor to allow multiple puppeteer services Fixed (thanks!), the MR of this issue now contains updates following the new plugin structure. New generators for each service (doppio or browserless) are implemented. This also includes some other general fixes.

Updated README for setup instructions.

Note that for both services, their API key can be added on settings.local with: $settings['page_to_pdf_api_key'] = API_KEY

Finally, not very important, I also wonder if we should refactor the project and substitute 'Puppeteer" with "PDF_service" on labels and variable names to reflect the latest changes that are tool-agnostic; it's basically now flexible to use external services that generate PDFs.

🇬🇧United Kingdom andreastkdf

andreastkdf made their first commit to this issue’s fork.

🇬🇧United Kingdom andreastkdf

Should the working patch #4 merged to the stable 8.x-1.20 release as it is still an issue on that version?

🇬🇧United Kingdom andreastkdf

The last commit is a re-roll for 2.0.x - merged 2.0.x and fixed conflicts. Pls ignore the other previous ones showing here, they are wrong, I've done a force reset, so the MR on git is ok and only showing my merge/fix conflicts commit.

🇬🇧United Kingdom andreastkdf

andreastkdf made their first commit to this issue’s fork.

🇬🇧United Kingdom andreastkdf

Actually, I just checked #8 (with the patch applied fyi) but the button is showing on new node and more importantly the core save button doesn't work at all. not sure if this should be a different new issue.

see screen record:

Production build 0.71.5 2024