Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following error appears in the Status Report after enabling Commerce Order module.
$info['types']['commerce_order-adjustments']
$info['types']['commerce_order_item-adjustments']
2.x-dev also here
when the Тoken module enabled
Comment | File | Size | Author |
---|---|---|---|
#21 | 2835693-21.patch | 734 bytes | jungle |
|
Comments
Comment #2
liva CreditAttribution: liva commentedComment #3
liva CreditAttribution: liva commentedComment #4
bojanz CreditAttribution: bojanz at Centarro commentedRetitling for clarity.
Unsure if we even need adjustment tokens, maybe we just need to make that message go away.
Comment #5
websiteworkspace CreditAttribution: websiteworkspace commentedI'm seeing the same problem using the latest dev branch:
Comment #6
websiteworkspace CreditAttribution: 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 CreditAttribution: 0Sarah0Al commentedI can see it too, in admin/reports/status page.
Comment #8
devad CreditAttribution: devad as a volunteer commentedComment #9
.jch CreditAttribution: .jch as a volunteer and 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 CreditAttribution: sealionking commentedthe same status
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedSame here:
Comment #12
wavesailor CreditAttribution: wavesailor as a volunteer commentedI get the same message
Comment #13
snlnz CreditAttribution: snlnz commentedRunning:
Drupal 8.7.3
Commerce 2.13
PHP 7.3
Seeing the same status message.
Comment #14
andrimont CreditAttribution: 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 CreditAttribution: milovan commentedI am getting:
Token types do not have any tokens defined
Comment #16
briantes CreditAttribution: briantes commentedI get the same. Any solution?
Comment #17
tonytheferg CreditAttribution: tonytheferg commentedSame.
Comment #18
jsacksick CreditAttribution: jsacksick at Centarro commentedBesides a message in the status report, is this affecting anything? If not, I consider that a minor issue.
Comment #19
bbuchert CreditAttribution: bbuchert commentedIt is just the status report for me.
Comment #20
tonytheferg CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: jsacksick at Centarro 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 CreditAttribution: fchandler as a volunteer 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 CreditAttribution: 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 CreditAttribution: 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.