- Issue created by @FeyP
- Issue was unassigned.
- last update
about 1 year ago 227 pass - Status changed to RTBC
11 months ago 6:21pm 22 December 2023 - πΊπΈUnited States Scott Weston
Tested patch #2 on clean, Standard installation of Core version 10.2.0, Token 8.x-1.13, and Scheduler 2.0.1. The patch resolves the issue and clears an error message in Status Report: "Token types are not defined but have tokens - $info['types']['taxonomy_term']"
- Status changed to Needs work
11 months ago 10:56pm 31 December 2023 - π¬π§United Kingdom jonathan1055
Thanks FeyP for reporting this. I will replicate and check, but it does sound like a problem. I think the test coverage for tokens needs to be expanded to cover taxonomy terms, as this should have been tested for. I guess I skipped that when writing the taxonomy plugin.
Another way to solve this would be to add a new property to the plugin, and let it default to the entity type, but define it specifically for taxonomy terms.
- Merge request !108Issue #3397181: Wrong token type for taxonomy terms β (Merged) created by jonathan1055
- last update
11 months ago 227 pass - π¬π§United Kingdom jonathan1055
FeyP,
Did you actually try using the scheduler tokens for a taxonomy term in a taxonomy description? Currently neither[taxonomy_term:scheduler-publish]
or[term:scheduler-publish]
get resolved and rendered as a date, when testing in the UI. But the testSchedulerTokenReplacement does cover taxonomy terms, amd the test passes with and without your change. I think it may be because we also need to make the equivalent change in that you did inScott Weston,
Thanks for pointing out
an error message in Status Report: Token types are not defined but have tokens - $info['types']['taxonomy_term']
I missed that entirely because it is displayed in the ordinary info section. It would be helpful if is was in the 'warnings' section like other mis-configurations and problems.
- π¬π§United Kingdom jonathan1055
I have updated the test to use the token type not the entity type. This next commit should fail for the taxonomy tokens test.
- last update
11 months ago 224 pass, 1 fail - π¬π§United Kingdom jonathan1055
As intended, we now get the single test failure
Drupal\Tests\scheduler\Functional\SchedulerTokenReplaceTest::testSchedulerTokenReplacement with data set "#taxonomy_term" ('taxonomy_term', 'test_vocab') Scheduler tokens replaced correctly for format. Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'Publish on: Wed, 01/03/2024 - 04:42. Unpublish on: Wed, 01/03/2024 - 05:42.' +'Publish on: [term:scheduler-publish]. Unpublish on: [term:scheduler-unpublish].'
The above shows that when correctly using the token type in the test, the token is not rendered. Will be a simple fix.
- last update
11 months ago 3 pass, 29 fail - last update
11 months ago 3 pass, 29 fail -
jonathan1055 β
committed ed83d764 on 2.x
Issue #3397181 by jonathan1055, FeyP: Wrong token type used for taxonomy...
-
jonathan1055 β
committed ed83d764 on 2.x
- Status changed to Fixed
11 months ago 5:38pm 13 January 2024 - π¬π§United Kingdom jonathan1055
Tests pass on gitlab pipeline. The fails on drupal.org are deprecations on 3rd-party dependency modules, see π Tests fail with "Using a translatable string as a category for field type is deprecated" Active
Therefore merging this.
Thank you @FeyP for reporting, and for the first patch. Automatically closed - issue fixed for 2 weeks with no activity.
- heddn Nicaragua
This puts a hidden dependency on token.module. Or at least, my kernel tests (which didn't have token required previously) now require me to add token. Because otherwise,
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "token.entity_mapper".
- π¬π§United Kingdom jonathan1055
Oh. There is a comment
// This function should only get executed if the Token module is enabled, // therefore we can assume the token.entity_mapper service exists without // having to check for it.
but that is clearly wrong if your tests break. Can you open a new issue please?
- π¬π§United Kingdom jonathan1055
The new issue to fix this is π Call to non-existent token.entity_mapper service when Token is not installed Active