- 🇳🇿New Zealand atowl
We ran into some caching issues with this, where it would not get the new entity (ie page) due to being cached already.
To solve this, moved the logic for doing the preferred link into the preprocess hook, and into its own render array with `#cache => max-age = 0`
As i understand it, it will now always re-render that array into the template. And hence always get the preferred link.
I haven't done anything quite like this before so if that's the wrong approach let me know.Thanks
- 🇳🇿New Zealand atowl
Sorry - last patch didn't include the shift of the configuration out of the if statement. This caused a get on null error.
Fixed. - Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass Had and issue where the copy link button would copy the original URL not the preferred URL
- Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7last update
about 1 year ago Waiting for branch to pass - 🇳🇿New Zealand atowl
Found an issue with this approach, the max-age should not be set to 0, then drupal never caches it.
instead, so we can use caching, set 'contexts' to 'url'.
Not sure if its the right thing to do, as i don't know enough about caching here.