Closed (fixed)
Project:
Custom Language field
Version:
8.x-1.9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2023 at 15:10 UTC
Updated:
28 Mar 2023 at 12:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fathima.asmat commentedPatch attached.
Comment #3
fathima.asmat commentedComment #4
indrapatil commented@fathima.asmat could please add the steps on how to test in the issue summary?
Thank you.
Comment #5
fathima.asmat commentedComment #6
johnvI cannot reproduce the problem.
I guess you have also installed Token module, and some module to add tokens in the view mode, like Automatic Entity Labels?
Comment #8
johnvHmm,
I have committed the patch, since it does not hurt.
But there must be something else wrong in your installation. The same code is used in other fields for Token support.
You state it happens with new node, after adding the new field.
Please check if you are not mixing [node:field_language:langcode] and [node:language:langcode]
Comment #9
fathima.asmat commentedThanks @johnv for merging the fix.
If this is the case, shouldn't the module declare the
tokenand the other contrib module as dependencies from the info file and install them as well during the module installation?The following bit of code checks the token module service to grab the token type and if not available the module skips from setting up the tokens from the
token_infohook.This seems like
tokenis a strict dependency for this module, hence should be defined ininfo.ymlas a dependency, perhaps this needs to be created as a separate issue?Comment #10
johnvToken module is not required for this module to work properly.
It is/was however my impression that the hook_tokens was only called by the Token module (Which is not, it is a core hook: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Utility%2... )
I still cannot reproduce your problem.
Upon saving and displaying a node, you need some extra step in the test script in order to make it reproducable.
It seems you installation is requesting for delta values that do not exist.
What is the cardinality of your field?