Drupal is up and running but how do I ...?

Subtract two date fields using twig

Hi,

Would be grateful for some assistance with this.

I am building a webform using the webforms module in Drupal 10 and I want to subtract two date fields and as a result display the difference between the dates.

For example, {{ 11-01-2024 - 10-01-2024 }} = {TheDifferenceInDays}.

I have tried using the following expression in my computed twig field however this is returning a value of 0 - is that because the date fields need to be in a specific format?

{{ date1 -  date2 }} 

Thanks

All revisions have the same timestamp, why?

I'm having this issue where all the revisions have the latest timestamp of when the node was last saved. I need these to show the real revision time, any idea what could be causing this? Thanks.

CKEditor 5: How do I keep a soft hyphen ­ in the source code?

If you add a ­ in the source code, switch back to text edit and then look into the source code again, the ­ is gone. CKEditor 5 replaces it with an invisible /u00AD, which is still a soft hyphen.
BUT … since the Unicode character is invisible, an editor has no chance to see if and where a ­ has been added. Why does CKEditor hide this information?

Boost cache suddenly becoming huge

Starting around 10 days ago the boost cache on a few of my Drupal 7 sites have grown exponentially. On one site I have just cleared 232Gb from the cache/normal directory.

Most of the cache files are in a particular directory relating to a node type. This node type is for hotels which are imported via an api. At present there are 30,000 of these. Obviously this is a lot, but it has been this many for years without the cache being massive. In fact, looking at the disk usage it is a very sudden and sharp rise.

Token replacement stop working for some tokens

In drupal system mail, where the welcome mail is sent, password reset request is sent and so on. It uses some tokens like user:name, site:name etc. The mail is successfully sent out but some tokens are not replaced, it just says [user:name]. What could cause this and why suddenly. It had worked perfect before but not now.

2 ERROR PHP AFTER CRON MANUALLY

DRUPAL 10.2.1 - PHP 8.3 - MySQL 8.0.32-24

Grazie! www.evangelici.info

Pages

Subscribe with RSS Subscribe to RSS - Post installation