I have following issue:
I use following PHP Code to generate a number with the Serial module
$entity_field[0]['value'] = str_pad($field->field_serial [LANGUAGE_NONE] [0]['value'], 6, '0', STR_PAD_LEFT);
I have no errors in the Drupal log but it generates only sometimes the Number. I my database it saves only 000000. I use the varchar data type. In the token of the title it shows me sometimes the correct number/value but after resaving the node all is again on 000000. What make i wrong? Can anyone help me?
I want use the Number/Field later as Token for URL and Title.
Comments
Comment #1
zwerg commented+1, same issue
Comment #2
zwerg commentedFound a solution:
computed code:
display code:
If you want to use it for auto-sku in shopping systems you have to check the "computed" pattern.