Postponed
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Order
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2016 at 09:18 UTC
Updated:
4 Dec 2025 at 14:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
liva commentedComment #3
liva commentedComment #4
bojanz commentedRetitling for clarity.
Unsure if we even need adjustment tokens, maybe we just need to make that message go away.
Comment #5
websiteworkspace commentedI'm seeing the same problem using the latest dev branch:
Comment #6
websiteworkspace commentedThis bug/problem still exists with the latest daily dev branch release of Commerce 2.x, as is visible on the admin/reports/status page.
Comment #7
0sarah0al commentedI can see it too, in admin/reports/status page.
Comment #8
devad commentedComment #9
.jch commentedvendor\drupal\console\bin\drupal site:status ...for D8.5.1 PHP 7.2 and latest Commerce 8.x-2.x-dev build returns...
Token types do not have any tokens defined
$info[types][commerce_order-adjustments]
$info[types][commerce_order_item-adjustments]
$info[types][commerce_shipment-items]
Comment #10
sealionking commentedthe same status
Comment #11
Anonymous (not verified) commentedSame here:
Comment #12
wavesailor commentedI get the same message
Comment #13
snlnz commentedRunning:
Drupal 8.7.3
Commerce 2.13
PHP 7.3
Seeing the same status message.
Comment #14
andrimont commentedRunning:
Drupal 8.8.1
Commerce 2.16
PHP 7.3.11
Seeing the same status message w/ more undefined tokens :
Comment #15
milovan commentedI am getting:
Token types do not have any tokens defined
Comment #16
briantes commentedI get the same. Any solution?
Comment #17
tonytheferg commentedSame.
Comment #18
jsacksick commentedBesides a message in the status report, is this affecting anything? If not, I consider that a minor issue.
Comment #19
bbuchert commentedIt is just the status report for me.
Comment #20
tonytheferg commentedJust a status report, but leaves the impression something is wrong. Seems like we should either define some tokens or ditch the message if it's not a problem. 😂
Comment #21
jungleWith a new hook added into the token module here #3246693: Add a new hook to allow altering processed/sorted token info, it's possible to remove them now, by implementing the new hook.
Attaching a patch to get rid of the token types below.
As commerce_shipment is not included in the commerce project, the patch will not handle it here. However, the code is similar, you can write your own patch or implement the hook in your custom module.
To me, I just want to let such a message disappear from the status report page because I have not used those tokens.
Comment #22
sah62 commentedThe patch in #21, combined with the patch from #3246693: Add a new hook to allow altering processed/sorted token info, works fine for me. Here's a patch for Commerce Shipping: #3246787: No tokens found for adjustments
Comment #23
jsacksick commentedWe can probably be smarter and do that for all adjustment fields. But in any case, there's currently no point in committing this as there's no guarantee the token patch will go in, the approach wasn't even approved by the maintainers.
Comment #24
berdir> With a new hook added into the token module here #3246693: Add a new hook to allow altering processed/sorted token info, it's possible to remove them now, by implementing the new hook.
I don't understand this. The tokens are defined in field_token_info_alter(), you should be able to implement hook_module_implements_alter() and move the commerce_order hook to run after that one. Note that there is an issue to move them to the token module namespace, so I'd check for both field and token module hooks here.
That said, I'm also open to detect and prevent this issue in token.module directly.. We define the token type after a few initial checks, but we can introduce some logic to see if we did manage to define a token for this type and only define it if that's the case. I'd suggest a $field_tokens or similar variable that holds $info['tokens'][$field_token_name], and only if it's non-empty we define the type as well as the list tokens I guess.
Comment #25
fchandler commentedI still get these;
$info['types']['commerce_order-adjustments']
$info['types']['commerce_order_item-adjustments']
$info['types']['commerce_shipment-adjustments']
$info['types']['commerce_shipment-items']
even after applying this #2835693-21.patch, and #3246787: No tokens found for adjustments
Version: 8.x-2.29, Drupa 9.3.7, Apache/2.4.41 (Ubuntu), PHP 8.0.16, MySQL 5.7.31
Comment #26
joshuautley commentedI tested #21 and #22's suggested 2nd patch. I can confirm #22's suggested other patch worked ONLY after clearing the cache.
Running Drupal Version 9.4.3
RBTC
Comment #27
carlodimartino commentedI still get: TOKEN TYPES DO NOT HAVE ANY TOKENS DEFINED
for these;
$info['types']['commerce_order-adjustments']
$info['types']['commerce_order_item-adjustments']
even after applying 2835693-21.patch and flushing all caches.
Comment #28
dunot commentedConfirm 2835693/#21 + 3246693/#2 + drush cr on D10.5.7 & DC3.2 clears the message out.