Hello,
I found this while using another module that requires Entity Reference Quantity, but after testing I can confirm this error is occurring on this module.
When you create an entity reference field with quantity, the token :quantity for the field doesn't have a name, and the following warning message is displayed on Status Report page:
TOKENS OR TOKEN TYPES MISSING NAME PROPERTY
As you can see on attached screenshots, the referencing field does have tokens associated to it, but Quantity is missing name. This is happening for fields on content types and taxonomy terms - I didn't test it for other entity types.
I'm not sure if this token must be assigned on field creation or if some sort of hook_token_info_alter could solve that.
Regards,
Mauricio M. Silveira
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | property_definitions-3019432.patch | 763 bytes | t1d |
| #9 | tokens.png | 28.05 KB | szecsodimlaszlo |
| #2 | token_missing-3019432-2.patch | 1.02 KB | waverate |
| token_missing_name.png | 94.73 KB | maursilveira | |
| status_report_message.png | 57.16 KB | maursilveira |
Comments
Comment #2
waverate commentedPatch attached.
Comment #3
szecsodimlaszlo commentedI have the same problem as the OP.
And there is a related – now Closed (duplicate) – issue @Basic cart:
#2908116 - Token status report warning after Drupal core upgrade
#2 patch seems NOT solve the problem.
After patching I have got these two error messages:
Comment #4
waverate commented@szecsodimlaszlo. This issue and patch is for the Entity Reference Quantity module. Is this the module you are having problems with or is it the Basic Cart module?
Comment #5
szecsodimlaszlo commented@waverate, Basic Cart depends on Entity Reference Quantity. I am not 100% sure which one causes the errors. I haven't used either of them before.
Although, the first line of @maursilveira's second image shows me that he/she had the same error adding an Entity reference w/quantity by Basic Cart:
I got the same error that is why I guess it is caused by Entity Reference Quantity. I may be wrong.
(...)
Now, for testing purposes, I added a test field of Entity reference w/quantity field type to my Basic page content type. I got this error message on Status Report:
Drupal version: 8.7.2
Entity Reference Quantity: 8.x-1.x-dev with the patch #2
--
Examining again, the second error message I wrote above is probably not related to Entity Reference Quantity.
Comment #6
waverate commentedOkay. I didn't realize the Basic Cart module required Entity Reference Quantity.
The patch at #2 is automatically creating the tokens for any entity_type=node and field_type=entity_reference_quantity. In essence that is saying, if you have any Content Type and added an Entity Reference Quantity field to it; this patch should take care of creating the missing tokens ['quantity'] regardless of what you named the field.
1. Can you check the Status Report before and after the patch at #2? Let me know the error messages in each case.
2. I expect we should be able to fix the missing quantity tokens in this issue.
3. Once we complete item 2, we may need to fix $info['types']['basic_cart_order'] in #2908116: Token status report warning after Drupal core upgrade.
Comment #7
szecsodimlaszlo commented@waverate, I went back to a backup, reinstalled Basic Cart with its dependencies (Easy Install, Entity Reference Quantity, Telephone). It doesn't matter whether I use the above patch or not, I got the same error message on the Status Report:
The patched entity_reference_quantity.module:
Comment #8
waverate commentedComment #9
szecsodimlaszlo commented@waverate, it seems to me that [node:basic_cart_content] is an array or what. It may help.

Comment #10
waverate commentedI would have expected this to work:
Comment #11
szecsodimlaszlo commented@waverate, the code #10 is not working.
I checked your patch before. It does what we both expected. When I printed out the $info, I got this:
drupal_set_message($token_key . ': ' . $info['tokens'][$token_key]['quantity']['name']);Comment #12
waverate commentedWell, that’s what patch at #2 is supposed to do. #stumped.
Comment #13
szecsodimlaszlo commented@waverate, I went back to a backup and reinstalled Basic Cart with its dependencies again. Without selecting any of the content types for which I can have the "Add to cart" option of Basic Cart, I checked the field types in the foreach ($entity as $field_key => $field) loop in your patch. I realized that there is no entity_reference_quantity field type in this case while there is the error message on Status Report.
My conclusion is that this issue cannot be solved in the entity_reference_quantity_token_info_alter hook. The error must be generated earlier on the chain.
What do you think?
Comment #14
waverate commentedTo help troubleshoot this, you may want to use the Entity Reference Quantity module on its own instead of with Basic Cart. The missing tokens message occurs after the module is enabled and an Entity Reference Quantity field is added to a Content Type.
Comment #15
chucksimply commentedI've also installed the latest patch. Using Entity Reference Quantity on it's own (without basic cart).
And I'm still getting the same warning on the status report page...
Any updates on this patch?
Comment #16
t1d commentedHello,
I figured out that the propertyDefinitions were setting the Label as something that is NULL.
It doesn't seem to take the value defined in the field basic_cart_content of the node type basic_cart_order.
I looked in the other modules, a translatable element is defined in place of that.
Here is my patch. I don't know if it is really a problem, if you have renamed this field, but for me it fixes the issue.
Comment #17
hs@henrikstrindberg.se commentedThe patch #16 worked for me.
The error message is gone ("Tokens or token types missing name property
$info['tokens']['node-basic_cart_content']['quantity'])
Thanks
Comment #18
chucksimply commented#16 fixes the issue for me. Thanks!
Comment #21
l0ke