This has been brought up in the somehow related #2022...
Certain field values like the entity ID or created time (also the serial value from the respective Drupal module (not ported to Backdrop yet) are only available after node/entity save. If one needs these values in order to use it say in another field via tokens, they hit a wall of errors and need to resort in a lot of fiddling with custom code and/or use various "heavy" modules like Rules in order to do an update of the field value after node/entity save (some sort of second save if you like).
My personal recent use case involved the combined use of [node:nid]
and a serial field with the goal to auto-generate the node title (invoices). I resorted in using https://www.drupal.org/project/auto_entitylabel (but I guess I would have hit the same issues with https://www.drupal.org/project/auto_nodetitle too), but that spitted errors because the field values were not available during save (https://www.drupal.org/node/1445124). So, I had to use Rules + custom php code in order to update the node title after saving it.
So, as I said in that other issue...
Can we please have a generic solution to this issue here so that there's a hook or some sort of other means to make entity properties and field values available during save?
...I'm guessing how such a thing could work is that there would be an intermediate stage between saving things and displaying the results, where there is a check for empty/missing tokens/values. If empty tokens/values do exist, then we have a second round of some sort of background re-save where these things would actually have non-empty (not NULL?) values and the respective settings and/or field values get updated. Then the thing is displayed.
Does that make any sense at all?
Recent comments
The horrors of cut/paste! Brilliant, thanks.
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value:
The issue could be related to the Emojis in the body field. Can you check the Status report (admin/reports/status) for the item MySQL Database 4-byte UTF-8 support? To display Emojis, 4-byte UTF...
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value:
@argiepiano, thanks a lot! For Webform it will be always "webform_client_form_NID", correct?
How to add Webform ID to Captcha module?