- Issue created by @mlncn
- ๐บ๐ธUnited States mlncn Minneapolis, MN, USA
Possibly the behavior i documented only occurs when using Drupal's "Re-use field" feature.
Trying again with the patch from ๐ Remove uniqid field from serial storage table RTBC , and only putting the field on one content type (also using the field name `serial`, and also the phase of the moon was different, i don't know) new content did receive new serial numbers, but existing content did notโ the "Start on existing entities" option continued to do nothing at all (is open D7 bug #2906190: No data created to existing nodes โ in fact also current for D8/2.x?), but far worse when i edited content it all got the serial ID of "1". And then after creating a piece of content (entity_id 748320 in the table below) and seeing it go to two, i thought it would at least work for new content, but then the second new piece of content i created (id 748321) went to one!! (All other content IDs are existing, edited content.)
MariaDB [db]> SELECT * FROM node__field_serial; +---------+---------+-----------+-------------+----------+-------+--------------------+ | bundle | deleted | entity_id | revision_id | langcode | delta | field_serial_value | +---------+---------+-----------+-------------+----------+-------+--------------------+ | program | 0 | 533 | 1463984 | und | 0 | 1 | | program | 0 | 1790 | 1463983 | und | 0 | 1 | | program | 0 | 744127 | 1463982 | und | 0 | 1 | | program | 0 | 748320 | 1463986 | en | 0 | 2 | | program | 0 | 748321 | 1463987 | en | 0 | 1 | +---------+---------+-----------+-------------+----------+-------+--------------------+ MariaDB [db]> SELECT * FROM serial_16086b691b7fb65de27d49516009e1ca; +-----+ | sid | +-----+ | 1 | +-----+
This is a module with a lot of use but i wonder if those using it successfully are only when it is installed on a completely new site, possibly also starting with an older codebase that set things up better?
There are so many major issues still open (at least i'm not hitting #3076002: Serial ID doesn't start from 1 in a new content โ ) that i don't know where to start with fixing.
I would encourage the maintainers to start a new branch with ๐ Remove uniqid field from serial storage table RTBC and maybe some other straightforward improvements/fixes/simplifications as the start and then maybe the community can iterate fixes on that, starting with ๐ Serial not generating on entity save in certain contexts Needs work , but as of nowโ for myself i'm regretfully falling back to custom code.
- ๐บ๐ธUnited States mlncn Minneapolis, MN, USA
All right, tried one more time with no patches (same as to start) and now all new content gets the correct serial, while edited content gets a one.
Then tried re-using the field on another content type, and that worked the sameโ new content gets an independent, correct in serial number, and edited content gets a one.
Sorry for mucking up the issue queue but i still don't know what's going on here and don't know what i can trust :-(
- ๐บ๐ธUnited States mlncn Minneapolis, MN, USA
Well, using the issue fork from ๐ Remove uniqid field from serial storage table RTBC
And it is still a complete disaster. No serial IDs created retroactively. Only doing this on one content type for now.
MariaDB [db]> SELECT * FROM serial_0420c62dd723430557835bf4ac5a5493; Empty set (0.000 sec) MariaDB [db]> SELECT * FROM node__field_serial; Empty set (0.000 sec)
After editing one piece of content:
MariaDB [db]> SELECT * FROM node__field_serial; +------------+---------+-----------+-------------+----------+-------+--------------------+ | bundle | deleted | entity_id | revision_id | langcode | delta | field_serial_value | +------------+---------+-----------+-------------+----------+-------+--------------------+ | individual | 0 | 693010 | 1464063 | und | 0 | 1 | +------------+---------+-----------+-------------+----------+-------+--------------------+ 1 row in set (0.000 sec) MariaDB [db]> SELECT * FROM serial_0420c62dd723430557835bf4ac5a5493; Empty set (0.001 sec)
And then after creating one piece of content:
MariaDB [db]> SELECT * FROM node__field_serial; +------------+---------+-----------+-------------+----------+-------+--------------------+ | bundle | deleted | entity_id | revision_id | langcode | delta | field_serial_value | +------------+---------+-----------+-------------+----------+-------+--------------------+ | individual | 0 | 693010 | 1464063 | und | 0 | 1 | | individual | 0 | 748330 | 1464064 | en | 0 | 1 | +------------+---------+-----------+-------------+----------+-------+--------------------+ 2 rows in set (0.000 sec) MariaDB [db]> SELECT * FROM serial_0420c62dd723430557835bf4ac5a5493; +-----+ | sid | +-----+ | 1 | +-----+ 1 row in set (0.000 sec)