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.
I have an integer field with a default max length of 10 chars/digits. I can't use the nice [node:updated-date] (or whatever) token because it breaks this limit.
My scenario is with views bulk operations to update a field to contain the last updated date of the node.
I believe tokens should be responsible to disable field validation when tokens is active on a page? Correct me if I'm wrong... should VBO be responsible for stating which fields should be token enabled?
FYI, I have the latest everything installed (I believe)
Comments
Comment #1
rofsky CreditAttribution: rofsky commentedI have the same issue. +1
Comment #2
Dave ReidSeems like the actual issue here is with VBO and not token? Token doesn't do anything about any kind of size limits for fields.
Comment #3
dynamicdan CreditAttribution: dynamicdan commentedThe problem here is that if tokens are going to be enabled for a field then tokens should somehow also understand the field restrictions and remove them. If the token module wasn't enabled then VBO would have correct and valid validation on it's fields. IMO the token module is responsible for ensuring it will work when displayed to the user.
The other perspective may be that a module wanting to allow integration with tokens should make it easy. I don't think we can expect that all modules should provide custom integration with token. I'm assuming that Token is an extension.
Comment #4
Dave ReidBut the key here is Token doesn't actually do *anything* with field values. It only handles tokens in field description help text. Nothing what soever in the token module does anything with field values.
Comment #5
dynamicdan CreditAttribution: dynamicdan commentedTrue..
I am suggesting Token should do something with the field. No point showing Token options if none of the fields allow them.
Eg, all inputs restricted to integer only and so I can't use my [node-field-phone] token because I can only enter numbers.
Token should remove input restrictions and allow me to use any token... Perhaps somewhere on the server side an error could be thrown if after replacement the validation of the value fails.
This will become a growing problem with D8 and mobile support I believe.
Comment #6
Dave ReidYou are not understanding me. Token does *nothing* to allow tokens to be used in field values, hence it's not responsible for *anything* because *it didn't add anything to begin with*.
Edit: confused fields and tokens.
Comment #7
Dave ReidThe module *responsible* for allowing tokens to be used in field values should be the one to also allow longer input if desired, which likely is VBO.
Comment #8
Dave ReidMarking as cannnot fix based on #6 and #7.