How to keep unique values?

Created on 6 October 2023, about 1 year ago
Updated 2 March 2024, 9 months ago

I use the field on nodes that can be deleted. I find old values being reapplied to new content. How can I keep the serial number incrementing to the next value without using values that were previously used please?

πŸ’¬ Support request
Status

Postponed: needs info

Version

2.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States guymandude

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @guymandude
  • πŸ‡ΊπŸ‡ΈUnited States guymandude
  • Status changed to Postponed: needs info 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    I cannot reproduce this problem. Here are the steps I tried:

    1. Install Drupal 10.2 with the Standard profile.
    2. Enable the serial module.
    3. Add a Serial field to the Article content type.
    4. Add 3 Article nodes.
    5. Delete the third node.
    6. Add another Article node.
    7. Delete all nodes.
    8. Add another Article node.
    9. Check the database: SELECT * FROM node__field_serial;

    The result is that the serial value was set to 5.

    If you are still having this problem, please give similarly detailed steps to describe what you see.

  • πŸ‡ΊπŸ‡ΈUnited States guymandude

    Thanks for following-up. The server I was using for the original post is long-gone, but I should make you aware I tried using this module on a vanilla 10.2 install just a few days ago and had problems with it. Other people had the same problem apparently. If you posted this without actuallly testing it on 10.2, you might want to conduct some more tests...

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    Please try the beta3 version.

  • πŸ‡ΊπŸ‡ΈUnited States guymandude

    Just tried it and got wsod when adding it to a Content Type. I selected Serial from the list if available fields and as soon as I click Add the wsod appears. Here's some log info:

    Drupal\Core\Field\FieldException: Attempted to create an instance of field with name field_asset_id on entity type node when the field storage does not exist. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 316 of /var/www/html/drupal10/web/core/modules/field/src/Entity/FieldConfig.php).

  • πŸ‡ΊπŸ‡ΈUnited States guymandude

    Last time I was able to fix the site using this suggestion from another thread:

    Export site config: drush cex
    Find the config name for the broke field in the exported directory on the server. In my case it was: field.field.node.invoice.field_invoice_number
    run the delete config command (replace my config name with yours): drush config-delete field.field.node.invoice.field_invoice_number
    Clear cache

    I just tried doing it again but the content type still generates a wsod when trying to edit it.

  • πŸ‡ΊπŸ‡ΈUnited States guymandude

    just tried creating a whole new content type just to test Serial in a vanilla setting and same problems happened. I cannot delete that new content type either, it generates a wsod.

  • πŸ‡ΊπŸ‡ΈUnited States guymandude

    I happened to have another 10.2.2 box around do I decided to test Beta3 on it. It worked fine but there are differences between my boxes that might be helpful for you to know.

    This working 10.2.2 server was upgraded from 10.0.9

    When adding Serial Field to a Content Type on this box, the Serial Field was listed in the 'Number' section.

    When adding Serial Field to a Content Type on the other box, the Serial Field was listed in the 'Serial' section.

Production build 0.71.5 2024